Commit Graph

765 Commits

Author SHA1 Message Date
Moritz Kiefer
525521a850 Only match identifiers from DA.Internal.LF if they are in the right module (#3220) 2019-10-18 10:37:01 +00:00
Moritz Kiefer
36719717fa
Update to current state of progress reporting in LSP (#3211)
* Update to current state of progress reporting in LSP

* fix ide-debug-driver

* Fix tests

* Fix build of ghcide executable
2019-10-17 16:14:49 +02:00
Gerolf Seitz
a5921e0274 Properly fill eventId for active contracts (#3126)
* Properly fill eventId for active contracts

This gets rid of the last remaining bit that assumes
contractId==eventId.

Fixes #65.
Contributes to #2068.

* Do not conflate eventId and contractId in the daml-lf interpreter

* Do not treat contractId as eventId in Ledger.scala

* Remember the transaction that divulged a contract.

* In this scope we can treat divulged contracts the same as disclosed ones

* revert a few more syntactical changes to make the overall diff smaller

* retain the same behavior on the scenario service api

* fix unreleased after rebase
2019-10-16 17:02:04 +00:00
associahedron
a90a1e1e8e Add Numeric support to migrate. (#3195)
* Add Numeric support to migrate

* Generate GHC.Types definitions based on LF version.

* Add a migration test with Numerics.
2019-10-16 15:56:49 +00:00
Moritz Kiefer
f4766ad903 Forbid quantifiers in Any in the Haskell typechecker (#3200)
This is a followup to #3196 which updated the Scala typechecker
2019-10-16 15:10:45 +00:00
Remy
506a3be6e5 Revert "Revert "Intern all strings and dotted names in the DAML-LF protobuf encoding (#3067)"" (#3120)
This reverts commit 4596c1bde6.
2019-10-16 12:12:07 +00:00
Robin Krom
29424af721
language: dalf imports and a test (#3176)
* language: dalf imports and a test

This adds the possibility to directly import dalfs in a project. We test
that we can import the `simple-dalf` in the daml-assistant integation
tests. For now we only check that data type generation works, not yet
the template instance.

The following was fixed: When rewriting package self references, this
changes the hash of the package later on and leads to different package
hashes. Also we need to be careful to write the orignal binary
representation to this and not re-encode it because the encoding might
have changed with a different sdk.

* addressing moritz's comments.

* windows doesnt like bazel paths
2019-10-15 17:20:53 +02:00
Andreas Herrmann
3a94812b97 Test templateTypeRef across modules (#3185) 2019-10-15 15:04:30 +00:00
Moritz Kiefer
b568827563
Add createAndExercise to the standard library (#3182) 2019-10-15 15:03:25 +02:00
Andreas Herrmann
a49c6469c7 Implement templateTypeRep in DAML (#3174)
* Improve comment

https://github.com/digital-asset/daml/pull/3118#discussion_r332894977

* Implement templateTypeRep in DAML

* TemplateTypeRep tests: use === and =/=

https://github.com/digital-asset/daml/pull/3174#discussion_r334775937

* Switch to bintray ghc-lib 20191015
2019-10-15 10:08:41 +00:00
Remy
e45b585307 daml-lf: repackage daml-lf archive proto (daml_lf -> daml_lf_dev) (#3169) 2019-10-15 09:36:11 +00:00
Remy
d64df4b5f7 daml-lf: clean achive bazel build (#3175)
* clean the mess in daml-lf achive bazel build

* add release note

* Address Moritz's comments

* more release notes
2019-10-15 08:36:46 +00:00
associahedron
70b025b691 damldocs: change External:Archive to Archive in template docs (#3165)
* damldocs: change External:Archive to Archive in template docs

* Update tests
2019-10-14 16:32:13 +00:00
Remy
fc1a000090 daml-lf: rename daml_lf_archive_scala target to daml_lf_archive_reader (#3168)
* daml-lf: rename daml_lf_archive_scala target to daml_lf_archive_reader

* fix release
2019-10-14 14:53:50 +00:00
Remy
217405e883 daml-lf: Move archive protofile to a more usual place. (#3166)
* move daml-lf archive protobug to a more usual place

* formatting

* fix kvutils proto

* fix csharp namespace
2019-10-14 13:22:22 +00:00
Robin Krom
ca87b9c601
language: some small fixes to the daml source gen from dalfs. (#3151)
Two changes: Make sure `DA.Internal.Tempalte` is imported is necessary
and convert variants with unit argument correctly.
2019-10-14 11:44:25 +02:00
associahedron
bcf4aff2ab
damldocs: Do not filter templates and choices by export set (#3161)
* Do not filter choices or template fields by export list

* Add Template0
2019-10-14 09:43:18 +01:00
Moritz Kiefer
48eb360a4f Add AnyChoice type to DAML (#3152)
* Add AnyChoice type to DAML

fixes #3131

* Fix ProposalDesugared

* Fix trigger tests

* Use the proper ghc-lib urls
2019-10-10 16:46:55 +00:00
associahedron
172996e4db Restrict type-level nats to [0,37]. (#3139)
* Restrict type-level nats to [0,37]

* Update compiler/daml-lf-ast/src/DA/Daml/LF/Ast/TypeLevelNat.hs

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>
2019-10-10 12:20:24 +00:00
Robin Krom
09fa4cf588
language: fix: don't look for daml files in hidden directories (#3144)
* language: fix: don't look for daml files in hidden directories

Fixes #3134. When locating daml source files, we need to make sure we're
not recursing into the .daml directory, because it contains source files
of the dependencies.

* Update daml-assistant/integration-tests/src/Main.hs

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2019-10-10 12:33:19 +02:00
Moritz Kiefer
dcdcf7f0c0
Generalize AnyTemplate type to Any in DAML-LF (#3141)
* Generalize AnyTemplate type to Any in DAML-LF

See #3131 for the motivation for this. The tl;dr is that we need
something like AnyTemplate for choice types as well.

Since the protobuf was already more general in anticipation of such a
change, this change only changes the internal AST on the Haskell and
Scala side.

Since AnyTemplate change has never made it out of 1.dev, I updated the
changelog in the LF spec instead of adding a new entry.

* Update daml-lf/spec/daml-lf-1.rst

Co-Authored-By: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>

* windows debugging

* more windows debugging

* clean expunge

* don’t cat the config file

* remove comment on type equality

* windows …

* gnah

* foobar

* foobar

* does anything ever work?

* reenable caching

* Do not build daml-lf-ast separately
2019-10-10 08:51:52 +02:00
Robin Krom
f28dc104ca
language: create the package database from dalfs (#3140)
This moves the creation of a package database from given dalfs out of
the migrate command and into the init command. In particular, this makes
the process of creating a package database independent of the migrate
command.

It also changes the way this package database is created to be only
dependend on given dalf files.
2019-10-09 17:40:03 +02:00
Moritz Kiefer
f18c393866 Fix location of interface files in created dars (#3137)
fixes #3135
2019-10-09 08:39:50 +00:00
Moritz Kiefer
3b1d8dfe33 Remove custom State monad from daml-trigger (#3136) 2019-10-09 07:42:48 +00:00
Moritz Kiefer
7f58c5a0c8
Add DA.Action.State (#3133) 2019-10-08 18:04:48 +02:00
Robin Krom
0671d7b905
language: add internal command for generating source from dalf. (#3129)
* language: add internal command for generating source from dalf.

We add an internal command for generating DAML source code from .dalf
packages. Also adds an internal flag to tell the compiler, that it is
compiling generated source.
2019-10-08 17:35:33 +02:00
Andreas Herrmann
5266b042b2 Implement ToTextTemplateId in proto (#3118) 2019-10-07 14:56:52 +00:00
Remy
449500bad8 Revert "Intern all strings and dotted names in the DAML-LF protobuf encoding (#3067)" (#3114)
This reverts commit 68e4453324.
2019-10-04 16:13:27 +02:00
Martin Huschenbett
68e4453324 Intern all strings and dotted names in the DAML-LF protobuf encoding (#3067)
* Intern all strings and dotted names in the DAML-LF protobuf encoding

On one of our huge DAML code bases this has brought down the size of the
DALF by 60% and cut the memory usage during decoding by 50%.

The `@QUERY-LF` tests in the damlc integration tests check that the
interning actually works.

* Add scala decoder support for interned strings

* Memoize versionisOlderThan. Speeds up decoding by 6x.

* Properly fix the performance problem with version ordering

LanguageVersion.ordering was a `def` and not `val` causing us to
recreate the ordering tables every time.

* Clean up //daml-lf/archive:decode-test

* Use int32 for interning indices

* Adapt QUERY-LF tests

* Strip a few useless field_ prefixes

* Add test for uniqueness in interning tables

* Drop field_ prefix from jq queries

* Fix Scala encoder

* Fix bond-trading tests

* Rename decode-test to decode-tester

* Address @cocreature's comments

* daml-lf: proper versioning for reading internedStrings

* daml-lf repl: revert change
2019-10-04 11:26:31 +00:00
Moritz Kiefer
a25c2e9de3
Avoid normalizing include dirs (#3103)
* Avoid normalizing include dirs

Fixes #3099

See https://github.com/digital-asset/ghcide/pull/152 for the
corresponding PR in ghcide

* bump to proper ghcide rev

* bump haskell-lsp rev
2019-10-04 10:41:44 +02:00
Martin Huschenbett
6b1f65f006
Add a tool to generate simple DALF for plain DALF import test (#3102)
We're working on a feature to import plain DALFs without any attached
source or interface files into a DAML project. This PR provides a tool to
generate a simple DALF file for testing this feature.
2019-10-04 09:55:25 +02:00
associahedron
e4956ce4da
Forbid polymorphic Numeric literals. (#3085)
* Remove polymorphic literals from library

* Add BECastNumeric and BEShiftNumeric in DAML-LF AST.

* Update rest

* Copyright header

* Remove polymorphic literals from LF conversion.

* Update tests

* Add test for forbidden polymorphic literals

* Add newline in DA.Numeric

* use MulNumeric instead of CastNumeric in DA.Internal.Prelude
2019-10-02 16:01:13 +01:00
Martin Huschenbett
a5ff470929
Prepare @QUERY-LF tests for string interning (#3081)
After string interning we won't have direct access to string anymore but
rather need to go through the interning tables. This PR implements the
required infrastructure for that endeavour.
2019-10-01 20:31:30 +02:00
Martin Huschenbett
1128d83492
Write JSON files in damlc integration test (#3075)
* Write JSON files in damlc integration test

There were quite a few occurences where I needed to look at the JSON
representation of the generated DALF in the past. Particularly, when
trying to come up with the `@QUERY-LF` pragmas for new tests.

This PR writes the JSON files to disk next to the (pretty printed)
DALF files.

* Remove useless rewriting of numbers into strings
2019-10-01 17:04:55 +02:00
associahedron
125317cff0
Update rest of standard library for Numeric (#3063)
* Update rest of standard library for Numeric

* Fix position of CPP pragma
2019-09-30 11:03:16 +01:00
Andreas Herrmann
98bb580aa2 Bundle packages with SDK releases (#3056)
* Enable SDK daml-lib package dependencies

* integration-test: SDK daml-libs dependency

* trigger --> daml-trigger

Rename the trigger library package to match other builtin packages.

* Bundle daml-trigger.dar in SDK release tarball

* Describe SDK bundled packages in changelog

* Push case match inside expand

Addressing review comment
8208277747 (r329428240)
2019-09-30 09:15:11 +00:00
Rohan Jacob-Rao
32e3099ddf Template instance type synonym polish (#3054)
* Release note

* Desugaring is hard to type

* Upgrade hlint version to new ghc lib

* Use template instance type synonym in some tests

* Rm space
2019-09-27 18:07:39 +00:00
Anup Kalburgi
3686162c02
Adding visual -web command (#3009)
adding the visual-web command to damlc
2019-09-27 10:26:20 -04:00
Martin Huschenbett
3b42a447f3 Refactor DAML-LF encoder/decoder in prep for string interning (#3060)
* Refactor DAML-LF encoder/decoder in prep for string interning

Refactor the encoder/decoder such that all the functions concerned with
interning live next to each other and code will break once the types of
the protobuf messages change.

This PR is a pure refactoring and does not change any functionality.

* Fix typos
2019-09-27 12:40:05 +00:00
Martin Huschenbett
bb309794db Simplify the Haskell implementation of the DAML-LF decoder (#3053)
Right now, some functions are polymorphic in the monad we use. This is
absolutely unnecessary.

This PR fixes one monad and uses it all over the place. This is a pure
refactoring which doesn't change any functionality.
2019-09-26 18:29:46 +00:00
Rohan Jacob-Rao
5bcdb3e8a0
Desugar template instances to type synonyms instead of newtypes (#3013)
* Upgrade ghc-libs
* Convert template instances as type synonyms to DAML-LF
* Look for TEMPLATE_INSTANCE suffix for daml docs
* Update desugaring documentation
2019-09-26 14:05:47 -04:00
Martin Huschenbett
2df59be8b5 Fix issue with template instance constraint rewriting (#3010)
The compiler rewrites constraints like `Template (Foo t) => ...` into
`FooInstance t => ...`. Unfortunately, this rewriting does not yet kick in
when the constraint contains superfluous parentheses as in
`(Template (Foo t)) => ...`.

This PR fixes the problem.

Fixes #2994.
2019-09-26 15:24:21 +00:00
Martin Huschenbett
1f2a257208
Merge package reference detection into package id encoding (#3039)
* Merge package reference detection into package id encoding

Currently, the encoding of a DAML-LF package works in two phases:
1. We compute the set of all package ids refernced by the package to encode.
2. We use this set of package ids to form a table for interning that is then
   consulted during the encoding of package ids.

This PR changes it such that the interning table is computed while the
package is being encoded. New package ids are added to the table whenever
they are encountered for the first time.

This is in preparation for the general inlining of all strings, which will
use the same approach to building the interning table.

This PR is a pure refactoring and does not change any functionality.

* Addess @cocreature's comments

* Add unordered-containers as a dependency
2019-09-26 16:37:36 +02:00
Moritz Kiefer
51cc7cf509
Shorten test names in //compiler/damlc:integration-dev (#3046)
Previously the test names consisted of the full absolute file paths
which got unreadable very quickly. Sadly the absolute file paths still
leak into the error messages since I don’t know of a nice way to get
relative paths here (just making them relative to cwd doesn’t work)
but this is still much more readable.
2019-09-26 15:33:16 +02:00
Moritz Kiefer
39e60acb2b Unflake dlint in integration tests (#3045)
Previously, we sometimes missed the dlint hints because we got killed
due to a typechecking error before they were produced. Now, we
force them to be generated which should hopefully fix that.
2019-09-26 13:30:12 +00:00
Moritz Kiefer
5e9c950164 Fix damlc build error messages if LOCALE_ARCHIVE is not set (#3041)
* Fix damlc build error messages if LOCALE_ARCHIVE is not set

* Fix tests

* fix more tests
2019-09-26 12:00:44 +00:00
associahedron
a943287e8b Refactor Numeric literal conversion and add tests. (#3038)
* Refactoring numeric literals

* More refactoring.

* Simplify convertRationalNumericPoly logic

* Positive numeric literal tests.

* Fix error message

* Remove duplicate periods

* Add negative tests

* Add separate type signature in existing rational tests.
2019-09-26 09:47:36 +00:00
Martin Huschenbett
78e08c2119 Wait for lints in damlc integration tests (#3020)
Currently, the integration tests fail sometimes because of missing lints.
Our suspicion is that the linter gets killed when the type checker fails
before it managed to produce the lints. This change makes sure we wait for
the linter.
2019-09-25 22:58:37 +00:00
Moritz Kiefer
dade80afe1 Add a --target flag to the IDE (#3019)
It is really annoying to not be able to load code that requires 1.dev
in the IDE.
2019-09-25 11:45:14 +00:00
associahedron
46051e8d11
Start adding Numeric to the standard library. (#2950)
* Numeric implementation

* Dealing with all sorts of numeric literals.

* Fix DA.Generics

* Reduce code duplication with IF_NUMERIC

* Simplify Prelude with IF_NUMERIC

* Fix daml-lf validation for MUL_NUMERIC and DIV_NUMERIC
2019-09-25 10:56:33 +01:00
Remy
23c3c33fe1
scenario-service: run no validation, when called from ide (#3003) 2019-09-25 11:06:47 +02:00
Martin Huschenbett
2ac81ce4b8
Change Haskell implementation of DAML-LF encoder to monadic style (#3007)
This is in preparation for interning all strings during encoding, which
will replace the current reader monad by a state monad.

This PR does not change or add any functionality. It is purely a
refactoring.
2019-09-25 09:14:11 +02:00
Shayne Fletcher
f6173c0037 Update hlint (#2999)
* Sync to f65e69951032a4c2ab308fd3c3471cd833925abf

* In the DAML parse tree, ListComps are coming through as MonadComps

* Linting smoke tests for lists

* Punctuate test header for readability
2019-09-25 03:17:13 +00:00
Rohan Jacob-Rao
4d641dbb66 Fix a bug in template resugaring (#2942)
Under very specific circumstances, as presented in `TemplateSuperClassD`, the
template resugaring would fail and the compiler crash. This PR fixes the
problem.

It also adds test case `TemplateSuperClassF` for similar very specific
circumstances under which template resugaring would fail.
2019-09-24 21:38:13 +00:00
Shayne Fletcher
044560ad70
Update hlint (cabal changes) (#3011)
* Update hlint (cabal changes)

* Fix the now failing test
2019-09-24 17:21:20 -04:00
Moritz Kiefer
1d593f2a16 Deduce pkgname in damlc migrate from dalf not dar (#3000)
The filename of the dar is not something that you should rely on as
evidenced by the fact that we have a -o option to change it to
something completely different.
2019-09-24 15:13:57 +00:00
Moritz Kiefer
78e51090df Fix Windows CPP issues (#2991)
The issue was actually not really related to CPP but to the lack of
sandboxing on Windows. That resulted in us overwriting Prelude.hi from
the 1.dev rule with the Prelude.hi from the 1.6 rule in some cases
which caused the error we were seeing.

fixes #2983
2019-09-24 13:42:48 +00:00
Moritz Kiefer
2644c98508
Update comments for getSrcRoot to new semantics (#2990) 2019-09-24 10:12:38 +02:00
Moritz Kiefer
9decc6b25f Fix getSrcRoot for A/B.daml (#2989)
Previuosly we would return A for module A.B in A/B.daml which resulted
in us including /B.daml in the DAR instead of /A/B.daml.
2019-09-24 00:31:52 +00:00
Moritz Kiefer
2e9f300563 Address comments on AnyTemplate PRs (#2986)
* Address comments on AnyTemplate PRs

* Remove unnecessary HIDE
2019-09-23 17:58:02 +00:00
associahedron
db04b57f3e Name collision checking within a module. (#2981)
* Implement name collision check

* Better error messages

* Update copyright header

* Make the map strict

* Update collision test
2019-09-23 17:17:38 +00:00
Moritz Kiefer
bf3f0063d2
Get rid of ./build.sh scripts for damlc migrate (#2984)
Now that we have the build-options fields that makes for a much nicer
interface.
2019-09-23 19:08:30 +02:00
Martin Huschenbett
2eb538e1d1 Remove outdated comment regarding feature flags in compiler (#2985) 2019-09-23 16:34:53 +00:00
Moritz Kiefer
2ab06da199 Use a consistant include dir for cwd (#2978)
* Use a consistant include dir for cwd

See https://github.com/digital-asset/ghcide/pull/114 for the actual
fix.
This PR just bumps ghcide and adds a regression test. I’ll change the
revision before merging, I just want to test CI for now.

fixes #2929

* Switch to proper ghcide revision

* writeIfacesAndHie no longer exists

* Add changelog entry

* Maybe I should try to compile code before committing but I don’t want to

* Fix ghcide exe
2019-09-23 14:33:06 +00:00
Moritz Kiefer
7a2e12d6d2
[daml-triggers] Expose template data in CreateEvents (#2973)
Now that we have AnyTemplate, we can actually make the template data accessible.
2019-09-23 12:49:01 +02:00
Moritz Kiefer
2de32b7419
Include all daml files in dar if source points to a file (#2970)
Previously, we only included the source file itself but not its
dependencies which didn’t make much sense.

This fixes #2960
2019-09-23 11:14:35 +02:00
Moritz Kiefer
20b182fcf2 Workaround Windows CPP issues (#2966)
Not sure why this is failing but given that I won’t have the time to
investigate this today, feel free to merge this as a workaround for
now.

My current suspicion is that caching is broken somehow so maybe if the
nodes get recycled it will fix itself.
2019-09-20 11:14:38 +01:00
Shayne Fletcher
f7c52d4228 Disable redundant $ rule by default (#2962) 2019-09-19 19:12:21 +00:00
Moritz Kiefer
69da1d6379 Implement AnyTemplate in DAML (#2947)
* Implement AnyTemplate in DAML

* Fix doctest path

* Shuffle around CPP

* Do not hide anything

* Hide it again

* Clean build

* Enable caching again

* debug windows crap

* more tests

* reinstantiate full tests
2019-09-19 08:42:55 +00:00
Shayne Fletcher
11f29469fe Move the dump parse tree logic slightly (#2949) 2019-09-18 15:00:36 +00:00
Moritz Kiefer
b2b94ac835
Remove redundant dropWhile isTypeArg (#2943)
(_, args) is already the result of calling "span isTypeArg" so isTypeArg
can never return true here.
2019-09-18 13:37:08 +02:00
Moritz Kiefer
afde28f1da
Bump ghc-ghcide (#2936) 2019-09-18 10:29:02 +02:00
Remy
220a03c9e8 Daml-LF: make MUL_NUMERIC and DIV_NUMERIC multi-scale (#2921)
* daml-lf: Make MUL_NUMERIC and DIV_NUMERIC multi-scale

* update release notes

* compiler: fix with type change
2019-09-17 14:32:49 +00:00
Moritz Kiefer
36e95f6cf3
Add Any type and to_any/from_any primitives to protobuf (#2930)
* Add Any type and to_any/from_any primitives to protobuf

Following a suggestion by Rémy, the protobuf representation is more
general and is associated with an arbitrary type instead of a
typecon. This allows us to easily extend this later to a full Any
type.

I’ve still called the type in the protobuf Any instead of Haskell’s
Dynamic since I find AnyTemplate more clear than DynamicTemplate and
having AnyTemplate and Dynamic seems confusing.

Right now, the decoder enforces that the type is a TypeCon.

* Fix some mistakes in the spec

* Update daml-lf/spec/daml-lf-1.rst

Co-Authored-By: Remy <remy.haemmerle@daml.com>

* Update daml-lf/spec/daml-lf-1.rst

Co-Authored-By: Remy <remy.haemmerle@daml.com>

* Update daml-lf/spec/daml-lf-1.rst

Co-Authored-By: Remy <remy.haemmerle@daml.com>

* Update daml-lf/spec/daml-lf-1.rst

Co-Authored-By: Remy <remy.haemmerle@daml.com>

* Add evaluation rule for to_any_template

* Update daml-lf/spec/daml-lf-1.rst

Co-Authored-By: Remy <remy.haemmerle@daml.com>
2019-09-17 15:02:59 +02:00
Jost Berthold
277bfcbb70 HOTFIX damldoc: suppress instance docs when --data-only (#2927) 2019-09-17 11:55:51 +00:00
Remy
dc9429be1d Daml-LF: Add CAST_NUMERIC and SHIFT_NUMERIC (#2919)
* daml-lf: add CAST_NUMERIC and SHIFT_NUMERIC internally

* daml-lf: add CAST_NUMERIC and SHIFT_NUMERIC to archive proto

* daml-lf: update spec with CAST_NUMERIC and SHIFT_NUMERIC

* update release notes

* fix spec

* Address comments from Fran and Gerolf

* fix unrel
2019-09-17 08:52:54 +00:00
Martin Huschenbett
9a4735a9b3 Allow qualified import of generic templates (#2892)
* Allow for importig generic templates qualified

Currently, there's a bug which breaks `template instance` declarations when
the module containing the generic template definition is imported qualified.

This PR fixes this problem.

* Update ghc-lib, allowing qualified import of generic templates
2019-09-16 17:00:21 +00:00
Shayne Fletcher
4140b9e028
Don't disable $ rules (#2909) 2019-09-16 10:17:00 -04:00
Robin Krom
0f015e965f
language: support for automatic embeddings/projections in migation (#2893)
* language: support for automatic embeddings/projections in migation

This adds support to automatically generate embeddings/projections if an
optional field to a contract template is added. This allows generation
of migration contracts for these kind of updates.

* only project None entries

* added a test for optional field embedding/projection.
2019-09-16 14:31:38 +02:00
associahedron
dc32abb220
Add a CPP flag for each available DAML-LF feature. (#2896)
* Expose Daml LF features as a CPP flags.

* Add missing text dependency
2019-09-16 11:34:02 +01:00
Shayne Fletcher
c4c658dcb3
Add syntax tree dump support to damlc compile command (#2895) 2019-09-13 10:14:48 -04:00
Rohan Jacob-Rao
e1ff195cee
Update ghc-lib, adding locations to errors with generic templates (#2894)
* Update ghc-lib, adding some locations to errors with generic templates

* Test for template instance location
2019-09-13 10:11:00 -04:00
Jussi Mäki
868cb785ad
Preload packages to engine during upload (#2860)
* Preload packages to engine during upload

* Improve logging in KeyValueCommitting and add timing information

* Fix scenario service tests now that logging is done in interpreter
2019-09-13 14:31:52 +02:00
associahedron
183d28995f Make CPP work in damldocs. (#2891)
* Make CPP work in damldocs.

* buildifier

* Use getTemporaryDirectory

* lint
2019-09-13 11:09:39 +00:00
Shayne Fletcher
546a52e745
Remove two redundant parenthesizations (#2873)
* Remove two redundant parenthesizations

* Add test and improve comments

* Improve comments, start on some more tests (more to come)

* Bind to the newest hlint; more tests.
2019-09-11 12:41:33 -04:00
associahedron
2027d39206 Enable {-# LANGUAGE CPP #-} for daml. (#2878)
* Passing the preprocessor

* Add ghcversion.h

* Remove {-# LANGUAGE CPP #-} for now.

* Remove spurious #line

* Always add platform info, and pass -P flag

* buildifier

* Generate blank ghcversion.h to get around copyright headers check.

* Reviewer suggestions
2019-09-11 15:28:34 +00:00
Shayne Fletcher
388af4c29a
Default disable "Use camelCase" (#2885) 2019-09-11 10:30:45 -04:00
Robin Krom
41aa03c711
language: fix: missing template instances in package (#2884)
The package compiled via daml migrate was missing the actual
Upgrade/Rollback templates. This is because we used `type` instead of
`template instance` to define those templates. Also, apparently we need
to export UpgradeInstance/RollbackInstance from DA.Upgrade in the
standard library.
2019-09-11 16:05:46 +02:00
Moritz Kiefer
e2c3474f1c Upgrade ghcide to incorporate the latest changes (#2879) 2019-09-11 13:19:11 +00:00
Martin Huschenbett
2411fdb0e0 Allow exercising choices on generic templates in a generic context (#2871)
* Allow exercising choices on generic templates in a generic context

Every `template T a_1 a_n` gets desugared into a `class TInstance a_1 ... a_n`,
an instance
```
(*)    instance TInstance a_1 ... a_n => Template (T a_1 ... a_n)
```
and instances `instance TInstance a_1 ... a_n => Choice (T a_1 ... a_n) C R`
for each choice `C`.

Thus, a _generic_ exercise of a choice on `T t_1 ... t_n` needs to have the
`TInstance t_1 ... t_n` constraint in scope. However, we want to keep the
existence of the `TInstance` class an implementation detail and not expose
it to our users. Instead we want our users to add a `Template (T t_1 ... t_n)`
constraint when they want to perform the generic exercise.

Due to the (*) instance above, the constraint `Template (T t_1 ... t_n)`
is satisfied if and only if the constraint `TInstance t_1 ... t_n` is
satisfied. For the intent described above it would be necessary that GHC
conlcudes the latter from the former. Unfortunately, GHC's type system only
allows for concluding the former from the latter.

Thus, we add a preprocessing step which rewrites all constraints of
the form `Template (T t_1 ... t_n)` into `TInstance t_1 ... t_n`.

* Add test for fetchByKey
2019-09-11 09:41:21 +00:00
Moritz Kiefer
f7befca723
Get ghcide from the new upstream repo (#2867)
* Get ghcide from the new upstream repo

* Update azure-pipelines.yml

Co-Authored-By: Gary Verhaegen <gary.verhaegen@digitalasset.com>
2019-09-11 08:57:48 +02:00
Robin Krom
29b8aed5f1
language: fix: forgot to archive contract id in Update template. (#2869)
This makes sure the in-contract of the update gets archived before the
new updated contract is created.
2019-09-10 20:38:23 +02:00
Shayne Fletcher
5b6a809433
Remove (one) redundant parenthesization (#2865) 2019-09-10 12:19:49 -04:00
Gary Verhaegen
5234236639
add build-options to daml.yaml (#2772) 2019-09-10 18:16:33 +02:00
Martin Huschenbett
cb60a6d26e Avoid duplicate variant constructors (#2840)
GHC produces a function `$WFoo` for every variant data constructor `Foo`.
The conversion to DAML-LF produces a function `$ctor:Foo` which does exactly
the same. We stop doing this and use the `$WFoo` function instead.

The resulting code looks quite messy. I'll clean it up in a separate PR,
which will most likely involve some refactoring as well.
2019-09-10 13:58:06 +00:00
Shayne Fletcher
d4d757f8bc
Update hlint; disable bracket rules for now (#2837) 2019-09-10 09:57:27 -04:00
Martin Huschenbett
0fdf85442f
Improve UX of generic templates over Ledger API (#2779)
* Improve UX of generic templates over Ledger API

Currently, if you write
```
template Template t => Proposal t with
    receiver: Party
    asset: t
  where ...
template Iou with ...
template instance ProposalIou = Proposal Iou
```
you'll get the following DAML-LF types:
```
record Proposal t = { receiver : Party, asset : t }
record Iou = ...
record ProposalIou = { unpack : Proposal Iou }
```
The definition of `ProposalIou` is not particularly user friendly when used
over the Ledger API.

This PR changes the definition of `ProposalIou` to
```
record ProposalIou = { receiver : Party, asset : Iou }
```
Basically, the definition of `Proposal` is copied and `t` is instantiated
with `Iou`. This should make a much nicer UX.

* Update documentation

* Add test

* Fix docs examples

* Fix release notes
2019-09-10 14:38:25 +02:00
Ganesh Sittampalam
bb90002e66 ghcide: support hs-boot files (#2827) 2019-09-10 11:35:52 +02:00
Ganesh Sittampalam
21022f411b ghcide: make tests fail on unexpected diagnostic messages (#2813) (#2823)
This has the downside of relying on a timeout, experimentally tuned
to be 0.5s, as we have no other way of knowing when the server has
finished sending us messages.
2019-09-09 20:24:50 +02:00
Moritz Kiefer
d2b68d45d4 Rename hie-core to ghcide (#2820)
* Rename hie-core to ghcide

The name `hie-core` has caused a lot of confusion as to how we relate
to haskell-ide-engine so changing it should hopefully help with that.
I also think that ghcide is still a good name once we hopefully
integrate with haskell-ide-engine more closely.

The name ghcide seems to have a reasonable amount of support on
Twitter https://twitter.com/ndm_haskell/status/1170681262987710464
which is of course the only good way to come up with names.

* Add a readme that points people to the new directory.

* Fix bogus replacements

* Use a proper link

* links are hard
2019-09-09 13:55:16 +00:00
Neil Mitchell
a7002616a3 hie-core: Ignore packages that conflict with ghc in the hie.yaml (#2819) 2019-09-09 12:02:41 +02:00
jacg
cc452a626f hie-core: Remove code pretty printing from diagnostic output (#2810)
In moving from v. 0.15 to 0.16, haskell-lsp changed the type of the
value which ended up being passed to `pretty` from `Maybe Text` to
`Maybe LSP.NumberOrString`, thereby breaking the line of code which is
removed in this commit.

After discussion with @ndmitchell, it was observed that this code was
never useful, and fixing it was not worth the trouble.
2019-09-08 18:04:19 +02:00
Ganesh Sittampalam
a3111fadc1 A couple of improvements to the experience developing hie-core itself (#2812)
* Put information about the compiler pass in the _source field of Diagnostic

It's useful when looking at the hie-core command-line output to see where
a problem is coming from.

* include test code in hie-core's own cradle
2019-09-08 18:04:04 +02:00
Domen Kožar
0779776413 README: add notes for Nix installation (#2805) 2019-09-08 16:57:59 +02:00
Tobias Pflug
c09781bab2 Add languageclient-neovim info to README (#2806) 2019-09-08 16:36:38 +02:00
Moritz Kiefer
becb3ba8eb Fix hie-core cabal file metadata (#2804) 2019-09-07 15:06:25 +00:00
Neil Mitchell
bdcbf16462 #2326, GHC 8.4 compatibility (#2796)
* #2326, GHC 8.4 compatibility

* Fix up CI

* Add a Shake lower bound

* Upgrade to a hie-bios which is GHC 8.4 compatible

* Add a GHC 8.4 stack

* Fix HLint again
2019-09-07 16:23:14 +02:00
Robin Krom
aa1e95173a
language: check dflags for errors (#2748)
* language: check dflags for errors

We add a check when we build the dflags for cases that will lead to a
failed build and emmit a clearer error message. Currently this only
includes a check, to see whether the current installed unit id is also
imported as a package from the package database.

* exclude ghc-prim from check

* exclude code generation from dflag check

* add an internal option to turn dflags check off
2019-09-06 21:24:46 +02:00
Stefan Matting
43fc0a1c8b hie-core: Add instructions for Vim (#2793) 2019-09-06 15:30:48 +02:00
Neil Mitchell
6803310fb2 Constrain ghc so that people with 8.4 don't get install plans (#2790) 2019-09-06 14:42:19 +02:00
associahedron
3c78e6110f Move (/) to a Divisible class and drop the Fractional Int instance. (#2728)
* Move (/) into a separate typeclass.

* Update release notes.

* Wording change

* rst syntax!!!

* tweak release notes.

* Remove recip on Int test.

* deduplication of release notes.

* Fix release notes?
2019-09-06 11:51:51 +00:00
associahedron
a50e0c2e0e Move HasField to DA.Record in the stdlib docs. (#2764) 2019-09-06 10:28:24 +00:00
Andreas Herrmann
ed39800a9f Rename hazel_deps to hackage_deps (#2789)
* hazel_deps --> hackage_deps

Mechanical change:

```
sed -i 's/hazel_deps/hackage_deps/g' $(ag -l hazel_deps)
```

* Hazel dependencies --> Hackage dependencies
2019-09-06 09:01:09 +00:00
Neil Mitchell
fc159a2d41 Fix hie.yaml so you can still load hie-core in hie-core (#2786) 2019-09-06 06:43:31 +02:00
Anup Kalburgi
0a9e0a8911 Adding fields to template graphs (#2673)
* Adding more info to dor

* Adding fields to the graph

* Spelling mistakes and params

* Removing single line function

* Moving the duplicated code

* Revert "Moving the duplicated code"

This reverts commit 520b5d9b0d.

* Adding more structure to graph

* Working tests with graph which is more easy to understand and change.
have few more tests to migrate

* Adding edge details

* One more to go

* Adding more verbose field information

* All tests now tests the fields that are being added

* Removing unused Import

* defined not refined

* Unused imports

* Names need to be consitent

* Acutal and Expected, not expected and expected

* Removing unused export

* Lints
2019-09-05 15:57:58 +00:00
Bernhard Elsner
ad77aba246 Fix symbol in DA.Logic (#2765) 2019-09-05 12:17:28 +00:00
associahedron
ce52a0a24f
Escape all text in rst docs. (#2747)
* Escape text in rst.

* Fix the escaping

* Fix spacing and tests
2019-09-05 12:39:29 +01:00
Martin Huschenbett
b7bcba4ca7
Drop deprecated TextMap.filter from daml-stdlib (#2761)
It has been deprecated for a while now with a hint to use `filterWithKey`
instead. We should add
```haskell
filter : (v -> Bool) -> TextMap v -> TextMap v
```
after the next SDK release instead. This is tracked in #2760.
2019-09-05 13:34:49 +02:00
Martin Huschenbett
b95daba9ed Simplify conversion of top level bindings to DAML-LF (#2730)
At the top level we don't care if bindings are recursive or not. The logic
that takes care of this ignorance is currently mixed with the actual logic
for converting the bindings.

This PR separates these concerns properly. This is also in preparation for
another upcoming change which needs access to all top level bindings.
2019-09-02 19:51:03 +00:00
Martin Huschenbett
f787a0d715 Remove unused tracking of default methods from conversion to DAML-LF (#2729)
The removed code had a purpose in the past but has not been used anymore for
a while. Let's remove it.
2019-09-02 18:49:48 +00:00
Rohan Jacob-Rao
30fe23a4c1 Organise generic templates and instances into separate files (#2727)
* Organise generic templates and instances into separate files, add Fungibility

* Expect hlint warning in scenario
2019-09-02 18:39:45 +00:00
associahedron
ea9d9cb02e Convert Decimal type, literals, and primitives to Numeric when feature is available. (#2723)
* Add missing alpha-equivalence case.

* Type-level nat is not serializable.

* Convert decimal primitives as numeric primitives if feature is available.

* Convert decimal literals to numeric if available.

* Better approach to decimal primitves.

* Fixing BEDecimalFromText

* Add issue number

* Set Numeric feature at v1.7
2019-09-02 17:10:26 +00:00
Moritz Kiefer
336cad1016
Fix ghc-pkg runfiles (#2726)
This allows us to run "damlc build" in Bazel rules which is a
prerequisite for doing anything with DAML packages as they don’t work
with "damlc package".
2019-09-02 18:50:25 +02:00
Martin Huschenbett
222f8c6fc1
Revert type based computation of table headers in scenario view (#2704)
The type based computation doesn't work as intended. Let's go back to the
value based computation for now and fix it later.
2019-09-02 12:35:52 +02:00
Robin Krom
d5c6d93772
langauge: suppress warnings for unrecognised pragams in upgrades (#2711)
This make the build of upgrade modules a bit more quiet. The warnings
appear because in the generated generic instances there is an
unrecognised {-# NO_OVERLAPP #-} pragma annotation.
2019-08-30 12:21:01 +02:00
associahedron
0eed4afb3f Add Numeric literals in daml-lf-ast and daml-lf-proto. (#2706)
* Add Numeric literals.

* Decode numeric literals

* Add tests and fix Read for s=0

* lint

* Copyright header

* Use numericMaxScale in Serializability check

* Fix comment!
2019-08-30 08:45:03 +00:00
Remy
20649cf78e ledger-api: rename decimal field to numeric in value Proto (#2688)
* add Numeric.java

* ledger-api: rename `decimal` field to `numeric` in value protobuf

* Address Gerolf's comment

* ledger-api: add missing renammings

* ledger-api: relax syntax of numbers that can be sent as numerics

* extractor:  fix

* leger-api: change format of number though ledger api

* daml-lf: fix numeric regexp

* ledger: fix tests
2019-08-29 22:51:33 +00:00
Rohan Jacob-Rao
8dbc556655 Sketch of generic transfers and swaps (#2640)
* Templates and scenario for generic transfers

* Simplify transfer workflow by self-issuing cash

* Generic swap in the same style as Transferrable

* Use Template class constraints instead of *Instance constraints

* Shorter asset name for transferrable/swappable templates

* Shorten some stuff

* Simplify swap acceptance, remove dependency on transfers, add some checks in scenarios

* Remove FlexibleContexts extension which should be on by default

* Move Asset typeclass and Cash instance to separate module

* Rename Swap module to Swappable

* Revert change to VERSION file
2019-08-29 16:05:24 +00:00
Robin Krom
7fca591df0
replace main file with a pointer to the source root (#2687)
* language: compile everything in the source directory

This removes the need to specify a 'main'. Instead we 'source' in
daml.yaml should point to the source root directory.
2019-08-29 13:42:33 +02:00
Moritz Kiefer
3cda28935b Refactor DAR manifest reader (#2699)
* Refactor DAR manifest reader

This PR replaces the ad hoc string munging by a proper parser.

* Fix tests

* Fix more tests

* Factor out isHeaderChar
2019-08-29 10:26:53 +00:00
Moritz Kiefer
abfce20ce9
Fix damlc manifest writer (#2689)
Previously, we didn’t broke at 72 chars instead of 72 bytes and we did
not take the newline character into account.
2019-08-28 16:31:20 +02:00
Moritz Kiefer
664a633e20
Fix heap corruption in grpc-haskell-core (#2685)
The details are in the patch which I will also upstream.

fixes #2644
2019-08-28 16:21:37 +02:00
Martin Huschenbett
596058ac3f Allow boundedly polymorphic recursive functions without type annotation (#2684)
Currently, recursive top level functions whose type is boundedly polymorphic
require a type annotation to make it through the conversion to DAML-LF.

This PR changes the conversion slightly such that a type annotation is n o
longer required.

This fixes #2669.
2019-08-28 12:56:06 +00:00
associahedron
dce578bbea damlc: Add Numeric primitives and type-level nats. (#2670)
* Add Numeric primitives and type-level nats

* Statically enforce Numeric scale in serializability check
2019-08-28 12:30:33 +00:00
Martin Huschenbett
25d1e2ce63
Fix the safety of the empty map in the DAML-LF simplifier (#2679)
Currently, we use `Safe 1` as the safety of the `BEMapEmpty` primitive. This
is clearly wrong since `BEMapEmtpy` is not supposed to be applied to a value
(but only to a type). Thus, it must be `Safe 0`. This has not caused any
problems in the past because the type checker would have caught any
application of `BEMapEmpty` to a value.
2019-08-28 13:20:31 +02:00
Moritz Kiefer
52101479d4
Shutdown IdeState in withDamlIdeState (#2680)
Noticed this while trying to debug the segfaults.

I don’t have a concrete case where this causes issues (usually we only
call this once on startup so leaks are not an issue) but we might as
well do it properly.
2019-08-28 13:02:39 +02:00
Martin Huschenbett
016b73b3de Enable MonoLocalBinds and FlexibleContexts by default in DAML (#2678)
Both language extension are needed to improve the UX of generic templates.
Without them templates a la
```
template Template (A t) => B t with
```
would produce an error that we need `FlexibleContexts` for the
`Template (A t)` context and a warning suggesting to simplify it to
`AInstance t`. The latter would expose an implementation detail we prefer
to hide.
2019-08-28 10:21:54 +00:00
Shayne Fletcher
8bcf6bf568
Smoke tests for newly added dlint hints (#2672) 2019-08-27 15:09:52 -04:00
Anup Kalburgi
ff77b2e285 Correcting spelling mistakes (#2671) 2019-08-27 18:35:08 +00:00
associahedron
bd686aa6a0 damldocs: Rewrite class method extraction and fix handling of default methods. (#2667)
* Add test case for default method signature

* Fix default method docs

* lint

* Refactor ty calculation in getMethodDocs

* Add test for multiple names in one method type sig
2019-08-27 12:50:14 +00:00
Anup Kalburgi
09b766c502 Visual integration with LSP (#2597)
* daml visualize with lsp

* Working command execution with ide

* Have to call visual now

* Split function

* Wrong constuctions of world or the module

* Working almost

* Have to gather all modules

* Now works end to end. Considers all the daml files in workspace

* removing unused code

* removing unused dependency

* Removing unused JS code and better error message

* Function re-arrange

* Removing us of heaad, instead handling error

* Format and rearranging

* Removing unused assignment

* Formating everything

* missed dependency

* Generating visual only for the file that is open

* Using modules from generated pkg, error messages

* Bringing back the commands

* Names and formating

* consitent error message

* Removing Just pattern match using _use now

* package

* Moving visual to a different module

* Function simple

* Removing Rule as it increases memeory consumption

* TODO LSP error

* White space

* Fmt things

* Handling if command was executed for a non daml files

* Better error message

* debugging

* Fix executeCommand

* Adding tests to execute command. Thanks moritz

* Unwanted lines

* Spaces and comment

* 3rd time ?

* Spaces are white

* assert equal instead of assert bool
2019-08-26 15:47:29 +00:00
Robin Krom
c1e7f0ad61
language: use generic templates for upgrades (#2605)
* language: use generic templates for upgrades

Instead of generating templates we now have generic upgrade/rollback
templates in the standart library and we just create instances of in the
migration project. I will update the documentation in a follow up PR.
2019-08-26 15:30:47 +02:00
Remy
6a96060af1 daml-lf: udpate LF protobuf for numerics (#2649)
* daml-lf: update proto for Numerics

* daml-lf: test decoder

* daml-lf: update spec

* daml-lf: polish proto doc

* damlc: address reviewers' comments

* daml-lf: minor fix
2019-08-26 11:55:48 +00:00
Moritz Kiefer
67c2e2a9ef
Switch to upstream gRPC-haskell (#2642)
* Switch to upstream gRPC-haskell
2019-08-23 15:10:15 +02:00
Moritz Kiefer
0419e31f0c Mark doctest integration tests as flaky (#2645)
They fail a bit too often to not mark them flaky. I’ve opened
https://github.com/digital-asset/daml/issues/2644 to track this.
2019-08-23 07:57:10 +00:00
Remy
997212c8f4
daml-lf: decommission internal Decimal type in favor of Numeric. (#2594)
* daml-lf: ValueDecimal -> ValueNumeric
* Apply suggestions from Stephen's code review
   Co-Authored-By: Stephen Compall <stephen.compall@daml.com>
* extractor: add comment about Numeric SQL format
2019-08-22 18:07:47 +02:00
associahedron
271795a6d0 damldocs: Only strip implied typeclass member constraint, not all constraints. (#2632)
* Add test case for canstrained class method.

* Fix constrained class methods bug.

* dubious lint
2019-08-22 14:44:17 +00:00
Moritz Kiefer
9654af6a26
Output more information on failure in the doctest integration tests (#2634) 2019-08-22 16:38:54 +02:00
Moritz Kiefer
88c2a1fd15 Add stripInfix to daml stdlib (#2629)
fixes #2617
2019-08-22 13:21:03 +00:00
Moritz Kiefer
03468a72ea Fix VSCode extension if extraArguments is empty (#2625)
Apparently somebody thought that splitting an empty string should
return a singleton array …
2019-08-22 08:16:59 +00:00
Moritz Kiefer
2a9eee8fae Add an extraArguments config in the VSCode extension (#2620)
This allows passing extra arguments like `--ghc-option -W`.
2019-08-21 18:50:27 +00:00
Moritz Kiefer
82ad89e770 Support --ghc-option in damlc ide (#2619)
fixes #2612
2019-08-21 13:56:15 +00:00
associahedron
e367f000a7 Hide GHC.Base.(++) (#2616) 2019-08-21 11:29:38 +00:00
associahedron
f14a925a91 damldocs: External docs links. (#2589)
* Allow for external anchor locations.

* Extracting package names in types.

* Create external references to stdlib.

* Update golden tests.

* Refactor DA.Daml.Doc.Render.Monoid
2019-08-21 10:15:42 +00:00
Rohan Jacob-Rao
4c53841eeb
Upgrade ghc-lib, improving parsing of template headers (#2609)
* Update ghc-libs
* Test for parsing template headers
2019-08-20 13:24:15 -04:00
Moritz Kiefer
0e777d9fc8 Delete obsolete proto3-suite patch (#2601)
* Delete obsolete proto3-suite patch

My patch has been upstreamed so no need to keep it around in our repo.

* Upgrade proto3-wire

* Adapt to changes in proto3-suite
2019-08-20 10:17:26 +00:00
Robin Krom
2374b8c231
Migrate same package name (#2564)
* language: smoothing out the migration experience

Some improvements to make the migration process simpler when migrating
between packages with the same name, e.g. foo-1.0.0 -> foo-2.0.0. This
is the main use case.
2019-08-20 11:02:41 +02:00
Remy
2abf27cd67 Revert DAML-LF proto change for Numeric (#2600)
* Revert DAML-LF proto change for Numeric

This partially reverts commit 0ffe5945b8.

* daml-lf: udpate release notes

* Apply suggestions from code review

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>
2019-08-20 08:13:15 +00:00
Martin Huschenbett
f11e09f60f Stop highlighting signature as a keyword in the IDE (#2599)
This fixes #2598.
2019-08-20 07:23:39 +00:00
Moritz Kiefer
3e2ccc0842
Switch to a streaming zip encoding (#2595)
This switches the creation of the archive in `daml build` from
`zip-archive` to `zip`. This has a few advantages:

1. It gets rid of lazy IO for reading all the interface and source
files. This avoids the high usage of file handles in `daml build`.

2. It seems to be a slight improvement in max memory usage and runtime
and a giant improvement in allocations (but I think the latter
probably comes primarily from the fact that the locations are moved to
the bzip C library). The improvement in max memory usage is less than
I expected so probably there is still something off somewhere.

For now, I only switched over `createArchive`. Archive reading is
still done using `zip-archive`. We might want to switch that over in a
separate PR.
2019-08-19 20:15:13 +02:00
Bernhard Elsner
d9298c8744 Various improvements to make hs-bindings usable outside repo (#2583) 2019-08-19 16:44:45 +00:00
Robin Krom
4634d35df2
language: Check for different SDK versions when building pkg db (#2591)
* language: Check for different SDK versions when building pkg db

This fixes #2510. We check whether packages were compiled with differen
SDK versions and emmit an understandable error if so.

* addressing moritz comments
2019-08-19 18:43:18 +02:00
Moritz Kiefer
b4dc886fa8
Bump stackage (#2588)
* Bump stackage

This PR switches us over to the latest Stackage LTS 0.14.1 (we were on
0.13.x before, so this includes major bumps) and gets rid of some
obsolete overwrites.
2019-08-19 13:31:10 +02:00
Moritz Kiefer
02a148fbb6
Bump hie-bios (#2586)
This includes my patches to fix the Stack cradle in hie-bios so
hie-core should now work properly on Stack projects.
2019-08-19 11:13:13 +02:00
Shayne Fletcher
4b8ac32651
Update hie-core README emacs instructions (#2567)
* Update hie-core README emacs instructions

* Send the reader to MELPA
2019-08-16 13:43:49 -04:00
Martin Huschenbett
4ae8cfd940 Write template locations when converting to DAML-LF (#2575)
Until now we've omitted them for no good reason. Choice locations
will follow in a separate PR.
2019-08-16 14:16:45 +00:00
Martin Huschenbett
0a82d9fd18 Make stack traces work with cached top level values (#2560)
* Make stack traces work with cached top level values

For stack traces to work properly in the presence of cached top level values,
we need to cache the stack trace together with the value and restore the
stack trace when we get the value from the cache.

We also need to push location information under the monadic. Otherwise, the
location information will be removed from the continuation stack before the
monadic action is _executed_.

We also change one test case to use `fail` instead of `error` since `fail` is
more tricky than `error` (due to the lazy expression embedding in DAML-LF).
Unfortunately, the test did not work woth `fail` in the past because of the
issues fixed in this PR.

* Explain special cases when pushing location information
2019-08-15 17:28:26 +00:00
Andreas Herrmann
76b9a477b3 hie-bios: Don't hard-code import-dirs (#2562)
* hie-bios: Don't hard-code import-dirs

* Formatting
2019-08-15 16:08:35 +00:00
Robin Krom
f209950f0b
language: append the version to the output dar name by default. (#2559)
* language: append the version to the output dar name by default.

We now by default output foo-1.0.0.dar instead just foo.dar. Also the
maven coordinate default naming got removed.

* fixing integration tests and quickstart.dar occurences
2019-08-15 18:07:52 +02:00
Robin Krom
27d798d68a
language: use versioned name for conf files. (#2558)
Otherwise importing two different versions of the same package overrides
one conf file.
2019-08-15 16:12:42 +02:00
Andreas Herrmann
a7fac2fbee
hie-core exe: initDynLinker (#2555)
The hie-core tests are flaky in stack. They can fail with the following
error message

```
hie-core: panic! (the 'impossible' happened)\n  (GHC version 8.6.5 for x86_64-unknown-linux):
        Dynamic linker not initialised

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
```

Explicitly initializing the dynamic linker at session startup should
avoid this issue.
2019-08-15 15:27:26 +02:00
Moritz Kiefer
3554596f9a Wait for all gRPC requests to finish before shutting down gRPC (#2551)
This fixes all flakiness in `damlc test` that I was able to
reproduce. Previously, I got it to fail in about 10% of the cases
whereas now I have successfully run tests 200 times under load without
issues.

There were two issues at play here:

1. We run scenarios in separate threads to be able to kill the running
Shake session quickly even if a scenario has an infinite loop or
something like that (there is a timeout but it’s quite long). This
could result in one of those left-over threads trying to issue a
request while we are already trying to shut down.

To fix that, we wait for the concurrency semaphore to be empty before
shutting down.

2. Just waiting for scenario executions is not quite sufficient as
`runAction` does not wait for all rules to finish (we could just use
runActionSync in `damlc test` but I’d rather make this work
properly). While we do wait for all scenario executions to finish
there is one gRPC request in offInterest that we do not wait for:
gcCtxs.

To fix this, I’ve now routed all gRPC requests through the semaphore
which means that we will also wait for these requests to finish (or
prevent them from spawning).

This makes more sense anyway as scenario executions are mostly fairly
cheap requests while things like setting up the context are expensive
so we want to limit their concurrency.

We should make the concurrency limit configurable but I’ll leave that
for a separate PR.
2019-08-15 09:39:30 +00:00
Robin Krom
bf8d84216d
langauge: fix: broken package imports in ide (#2545)
We need to initialize the package database before we run
`defaultOptionsIO`, because the later filters package database path that
don't exist.
2019-08-15 11:39:15 +02:00
Andreas Herrmann
ad8c2e8426 Add more hie-core diagnostics tests (#2535)
* hie-core test: missing modules

* hie-core test: variable not in scope

* hie-core test: cyclic module dependency

* hie-core test: redundant import

* hie-core test: type error

* hie-core test: reorganise test

* hie-core test: factor out diagnostic tests

* Display unexpected diagnostics
2019-08-15 09:35:52 +00:00
Rohan Jacob-Rao
9ab3609772 Remove outdated todo (#2548) 2019-08-14 21:29:51 +00:00
Rohan Jacob-Rao
5bf86db2a1
Update generic templates (#2547)
* Extract template instance doc from newtype constructor doc
* Use new ghc-libs
* Remove type application which is not needed anymore
* Update daml-doc output with template instances
* Update hlint version
2019-08-14 16:28:35 -04:00
Shayne Fletcher
6defc5fdf8
More dlint smoke tests (#2546)
* More dlint smoke tests

* Fix test case name
2019-08-14 15:20:11 -04:00
Shayne Fletcher
f85e2430d1
Change default lexer mode to Opt_KeepRawTokenStream (#2542)
* Change default lexer mode to Opt_KeepRawTokenStream

* Set lexer to Opt_Haddock in daml-doc tests

* Set Opt_Haddock in another daml-doc test
2019-08-14 14:13:42 -04:00
Moritz Kiefer
c27e126267
Add a test that haddock comments are shown on hover (#2539)
Apparently, we never had any tests for this, so this PR adds at least
a rudamentary test. The logic for this is rather stupid and easy to
break and might change soon so I’ll hold off on adding more extensive
tests until this works a bit better.
2019-08-14 16:44:51 +02:00
Robin Krom
b85623d4d3
language: make sure conf files are uniform accross OS's. (#2538)
If a package is build on Windows, it puts '\' into the conf files, which
will not work on a Linux system. Now we always use '/' as path
separator.
2019-08-14 16:40:11 +02:00
Moritz Kiefer
126ad13326
Only register gRPC methods once (#2537)
SS.scenarioServiceClient does not just read the actual client from
some IORef, it registers the available gRPC methods. Apparently we
never knew about this or at least I didn’t.

By only doing this once, we should speed things up a bit and this
fixes once of the assertion failures that we have been seing on
shutdown (pthread_mutex_lock(&mu->mutex) == 0 in sync_posix.cc) which
was caused by trying to register a method from another thread after
destroying the channel.
2019-08-14 16:21:17 +02:00
Martin Huschenbett
3e5115edc7 Make damlc inspect work with DARs (#2534)
So far is can only pretty print DALFs. Now, you can give it a DAR and it
will pretty print the main DALF.
2019-08-14 12:39:36 +00:00
Martin Huschenbett
4f178a3a63 Simplify the pretty printing of location info in DAML-LF (#2530) 2019-08-14 10:05:50 +00:00
Moritz Kiefer
502b09e5e7 Mark the "damlc test" tests as flaky (#2527) 2019-08-14 09:04:09 +00:00
Martin Huschenbett
4a952d59ea Make the detail level of damlc inspect configurable (#2498)
Add a command line option to `damlc inspect` which allows for configuring the
details level of the pretty printed DAML-LF. Right now the only difference is
that levels bigger than 0 print all location information. Level 0, which is
the default, also prints location information top level declarations.

This feature is useful for debugging location information.
2019-08-14 07:54:20 +00:00
Martin Huschenbett
803fee057f Show function names in stack trace on failing scenario (#2516)
* Show function names in stack trace on failing scenario

So far, we've only shown the location of the function but not its name.
Now, we add the name of the function as well.
2019-08-14 09:16:07 +02:00
Moritz Kiefer
3eb112e4ca
Only report progress when client supports it (#2517)
* Only report progress when client supports it

This fixes an issue that some people encountered when running hie-core
in Emacs with a version of haskell-lsp that does not understand
progress events.

* Fix tests

* More test fixes
2019-08-13 20:00:21 +02:00
Gary Verhaegen
99ea93168d
update copyright notices (#2499) 2019-08-13 17:23:03 +01:00
Andreas Herrmann
a1c21d9829
Update rules haskell (#2509)
* update rules_haskell

* adapt rules_haskell patches

* io_tweag_rules_haskell --> rules_haskell

* io_tweag_rules_haskell --> rules_haskell

* haskell:haskell.bzl --> haskell:defs.bzl

* rules_haskell_dependencies
2019-08-13 16:46:31 +02:00
Moritz Kiefer
da3f295507
Add commands for inserting and deleting lines to ide-debug-driver (#2511) 2019-08-13 15:25:26 +02:00
Robin Krom
8400e33cb7
language: fix: compute correct source root when building dar (#2500)
* language: fix: compute correct source root when building dar

Previously we just took the base directory of the main file, which is
wrong when the main is deeper down in the module structure.

* hlinting

* reuse moduleImportPaths
2019-08-13 13:45:22 +02:00
Moritz Kiefer
052cbe0fd4
Fix more leaks in Development.IDE.Core.Shake (#2507)
We accumulated some thunks in those variables that leak over long
sessions.
2019-08-13 13:36:03 +02:00
Martin Huschenbett
c2940705ff Remove unused message from scenario service protobuf (#2503)
I assume the plan was to implement stack traces. I intend to do that as well
but the message type does not fit my approach. Thus, let's remove it first.
2019-08-13 07:07:38 +00:00
Martin Huschenbett
0ca2601cd9 Print stack traces in the scenario on failure (#2497)
* Print stack traces in the scenario on failure

Currently, we only print the last source location, which is not
particularly helpful for debugging. Now, we put all source locations we
encounter during execution on the continuation stack and print them when
a scenario fails. This PR does not print the names of entered functions
or choices. We leave this for a future PR.

* Address Moritz' comments
2019-08-12 19:05:19 +00:00
Moritz Kiefer
b87215e111 Remove the --dump-pom flag from damlc package (#2496)
It doesn’t serve any purpose at this point so we might as well get rid
of it.
2019-08-12 17:49:43 +00:00
Anup Kalburgi
c96dae3a52
Visual ide (#2467)
Generate visualization from IDE
2019-08-12 12:42:45 -04:00
Moritz Kiefer
9ce0d414c4
Force values in setValues and getValues (#2494)
Otherwise, we can end up retaining references to the old map which
prevent it from being garbage collected.

On a simple testcase that repeatedly opens and closes a module, this
seems to make memory usage constant whereas it was increasing
each time before.
2019-08-12 17:40:12 +02:00
associahedron
ed0d5667c2 damldocs: Small type rendering improvements. (#2492)
* Add parentheses around type operators in expressions.

* Remove levity arguments from (->) in stdlib docs

* Avoid parenthesizing type-level literals
2019-08-12 15:28:57 +00:00
Robin Krom
829cb4cef5
Daml stdlib with versions (#2479)
* language: build daml_stdlib with a version in the package name.

* versioned daml-stdlib in damlc

* reformat bazel files

* fix daml_doc_test
2019-08-12 16:05:28 +02:00
associahedron
b16f937d7e damldocs: Show relevant instances for types and classes. (#2487)
* Add md_instances field to ModuleDoc

* Extract instances

* Add instance fields to class and type docs.

* Implement distributeInstanceDocs

* Use Maybe list instead of list.

* Render instance docs.

* Add instance data in tests and add a golden test.

* Rename to orphan typeclass instances.
2019-08-12 13:48:46 +00:00
Martin Huschenbett
bbfa0a1318 Simplify test for issue with GHC.Tuple.Unit (#2475)
* Simplify test for issue with GHC.Tuple.Unit

* Make sure tests actually produces GHC.Tuple.Unit somewhere
2019-08-12 09:20:40 +00:00
Rohan Jacob-Rao
c2f315d2ba
Support generic templates (#2465)
* Upgrade ghc-libs supporting generic templates
* Update Proposal and ComposedKey tests to generic template syntax
* Temporarily patch daml-doc test output (will need to fix for template instances)
2019-08-09 17:15:51 -04:00
Moritz Kiefer
2b690fd420 Increase timeout on lsp-tests (#2478)
Now that they are no longer marked as flaky on Windows, we seem to be
hitting the actual Bazel timeout sometimes.
2019-08-09 15:32:32 +00:00
associahedron
2262c5add0
damldocs: Show only exported things. (#2477)
* Add exports to doc ctx

* Filter out unexported things.

* Added a golden test

* Fix missing constructors.

* Hide unexported class members

* Add rst golden test as well

* Remove unnecessary HIDEs from stdlib.

* lint
2019-08-09 16:12:47 +01:00
Moritz Kiefer
d388c5692b
Upgrade haskell-lsp and lsp-test (#2474)
* Upgrade haskell-lsp and lsp-test

There have been some fixes upstream that should hopefully mean that we
no longer need to mark the lsp-tests as flaky on Windows. I am having
trouble reproducing the flakiness locally, so let’s see what happens
on CI.

* Also bump stack.yaml
2019-08-09 15:09:59 +02:00
Martin Huschenbett
3c03d8c33b Simplify how we compute the label of a data constructor (#2473)
Currently, we pass the flavour of the type constructor around although that
is cheaply computable from the data constructor itself. Thus, don't pass the
flavour around.
2019-08-09 11:39:58 +00:00
Moritz Kiefer
491d13a276
Add an ide-debug-driver to make it easier to find leaks (#2472) 2019-08-09 12:48:05 +02:00
Martin Huschenbett
e9e96be3da Avoid one indirection when constructing enum values (#2469)
For every enum constructor `Foo` we produce a function `$ctor:Foo` whose
value is simply `Foo`. When we convert `Foo` to DAML-LF, we convert to
a call of `$ctor:Foo`. Since enum constructors are always fully applied,
this indirection is useless. Thus, we remove it in this PR.
2019-08-09 09:01:36 +00:00
Martin Huschenbett
9b1d5c8c32 Avoid duplicate record constructors (#2466)
GHC produces a function `$WFoo` for every record data constructor `Foo`.
The conversion to DAML-LF produces a function `$ctor:Foo` which does exactly
the same. We stop doing this and use the `$WFoo` function instead. Since GHC
does not produce `$WFoo` for newtypes, we need to produce these nevertheless.

I'll leave solving the corresponding issue for variant types to another PR.
2019-08-09 07:24:20 +00:00
Martin Huschenbett
53de4511ce Make DAML internal functions version independent (#2464)
Right now, the set of internal functions seems to depend on the DAML-LF
version although it actually doesn't. Since GHC is smart enough this doesn't
bite us but doesn't feel particularly clean either. If the internal functions
ever start to depend on the DAML-LF version again, we should probably put
them into the environment of the conversion to DAML-LF.
2019-08-08 18:32:10 +00:00
Martin Huschenbett
f357b2f0b7 Remove compiler code to inject DAML-LF primitives for old desugaring (#2462)
The code removed was responsible for injecting DAML-LF primitives for
`create`, `exercise`, etc. for the old template desugaring. These code
paths are not hit anymore with the new template desugaring.
2019-08-08 18:04:15 +00:00
Moritz Kiefer
bdd665fcf8
Only change project root once (#2459)
* Only change project root once

As described in #2449, calling withProjectRoot' twice breaks with
relative paths and is also just silly so this PR fixes this by
factoring out the actual logic from init from execInit which does the
project root thingy.

* Add a regression test
2019-08-08 19:56:04 +02:00
Martin Huschenbett
8fc5b62bd8
Avoid one indirection for dictionary construction (#2456)
* Avoid one indirection for dictionary construction

For every constructor `Foo` we generate a function `$ctor:Foo` which calls
the DAML-LF constructor for `Foo`. This function is useless since GHC already
creates a function `$WFoo` for us which does the same. This PR remove the
`$ctor:...` functions for type class dictionaries.

This makes a bit of a mess in the `Ctors` data type. This will be cleaned up
when all `$ctor:...` functions are finally gone.

* Fix construction of XInstance templates
2019-08-08 19:12:44 +02:00
Robin Krom
6ccb18be08
language: put pkg version into pkgname (#2454)
This is a small step to solve the package name ambiguity problem.
Putting the package version into the package name allows to import a
package two times with different versions.
2019-08-08 16:31:09 +02:00
Martin Huschenbett
4d0a62801c Fix pretty printing of empty annotations in DAML-LF AST (#2453)
For example, we print two spaces if there's no annotation between `def` and
the function. This PR fixes this by using the `empty` document instead of the
document containing the empty string. (Please don't ask me why they are
different.)
2019-08-08 12:11:56 +00:00
Moritz Kiefer
c5664fe5b5
Speed up dependency information chasing (#2444)
Comparing FilePaths is really slow so by mapping them to Ints, we can
speed up dependency chasing significantly.

We might want to switch to doing some kind of global hash consing of
file paths at the Shake level but for now, this seems like a nice
improvement while not being too invasive.

This is roughly an ~8s speedup on my testcase.
2019-08-07 16:51:38 +02:00
Martin Huschenbett
966dfbd400 Add test for manually desugared form of the generic proposal workflow (#2442)
Having a test that demonstrates how the desugared form of the template syntax
looks like seems to be a good idea.
2019-08-07 11:53:52 +00:00
Moritz Kiefer
b3e1833e71
Use FastString where possible and speed up conversions to Text (#2436)
This cuts allocations on my testcase by about 2% and provides a
similar speedup.
2019-08-07 11:03:40 +02:00
Martin Huschenbett
c0a07e7e07
Use template syntax in IOU proposal test (#2435)
Until now the test used the manually desugared syntax for the `Iou`
template. Now, we use the proper `template` syntax. The test is also
renamed from `IouDSL` to `ProposalIou` since the DSL would be confusing
after this change. In fact, we're mostly testing that the
instantiation of `Proposal a` with `a = Iou` actually works.
2019-08-07 10:04:45 +02:00
Martin Huschenbett
c63782791e Remove tests that are obsolete with new template desugaring (#2434)
* Remove tests that are obsolete with new template desugaring

The tests were only relevant during the transition phase to the new
template desugaring. Since that desugaring has landed the test don't
provide value anymore and can be deleted.

* Fix super class dictionary detection
2019-08-06 18:22:49 +00:00
Moritz Kiefer
d95d25fd2f Speed up convertModuleName (#2432)
On my testcase, this cuts allocations by about 6%.
2019-08-06 18:14:34 +00:00
Martin Huschenbett
15f94783d8
Use tasty-golden for daml-doc's golden tests (#2429)
* Use tasty-golden for daml-doc's golden tests

With our hand rolled version of golden tests it is pretty painful to update
the golden files when they must change. After this PR it is as simple as
```
> bazel run //compiler/damlc/tests:daml-doc -- --accept
```

* Address indentation issues

* Use diff command line tool for diffing

* Removed new unused dependecy on Diff package

* Ignore carriage returns in diff
2019-08-06 19:47:52 +02:00
Shayne Fletcher
1308c8232b
hlint => dlint everywhere (#2409) 2019-08-06 13:42:36 -04:00
Moritz Kiefer
180313b404
Unrecursionschemify freeVars calculation (#2427)
This cuts allocations and speeds things up (admittedly not by a whole
lot) but it also lets us delete a bunch of code which is always nice.
2019-08-06 19:33:11 +02:00
Anup Kalburgi
629266a445
Addressing comments on a previous PR #2371 (#2408) 2019-08-06 12:48:54 -04:00
Moritz Kiefer
859ac379de
Move simplification to GenerateRawDalf (#2424)
This allows us to GC the unsimplified DALF which decreases memory
usage and GC pressure. This does make GenerateRawDalf slightly slower
which could in theory have an effect on IDE performance since we use
the raw DALF for the scenario service. However, I haven’t been able to
measure any regressions (if it does become an issue, we could disable
optimizations completely in the IDE). In fact, things seem to be
slightly faster.

On my testcase max memory usage does seem to go down a bit but not a
lot (3.0GB to 2.7GB but it fluctuates somewhat between runs).
2019-08-06 16:40:29 +02:00
Martin Huschenbett
d723db8fca Simplify test for different choice syntaxes (#2405)
* Simplify test for different choice syntaxes

* Test for scoping rules of flexible controllers as well
2019-08-06 14:19:47 +00:00
Moritz Kiefer
a1ac927add
Avoid converting DARs to a strict bytestring (#2423)
Converting it to a strict bytestring only to then write it to disk
doesn’t make much sense.
2019-08-06 16:16:14 +02:00
Moritz Kiefer
d630b7134d
Activate VSCode extension on daml.resetTelemetryConsent (#2421)
Otherwise, you will get an error if you run the resetTelemetryConsent
command without having opened a .daml file.
2019-08-06 14:43:35 +02:00
Shayne Fletcher
c8783d08bb Upgrade hlint (#2406)
* Upgrade hlint

* Reduce duplication
2019-08-05 18:45:31 +00:00
Martin Huschenbett
3a02b56117 Merge the Iou12 and Iou_template test into one test (#2407)
They differ only marginally and I don't see any reason why they should be
two different tests.
2019-08-05 17:14:59 +00:00
Martin Huschenbett
ecc66604b5 Simplify test for unserializability check (#2404) 2019-08-05 17:05:12 +00:00
Martin Huschenbett
f669d7e572 Remove the old template resugaring from the GHC Core -> DAML-LF conversion (#2400)
Since we changed how the parser desugares templates, this code path won't be
hit anymore.
2019-08-05 16:38:11 +00:00
Moritz Kiefer
a967b872e2 Use a single map for RawDependencyInformation (#2399)
This cuts allocations a bit and makes things slightly faster (sadly
not a lot).
2019-08-05 16:21:36 +00:00
Rohan Jacob-Rao
4fc121db60 Use template-let-bound function in signatory decl (#2401) 2019-08-05 16:10:15 +00:00
associahedron
9042d14cb1 Damldocs qualified flag (#2394)
* Rename HaddockParse -> Extract

* Add --qualify-types option.

* More qualified type options

* Update help text

* Update compiler/damlc/lib/DA/Cli/Damlc/Command/Damldoc.hs

Co-Authored-By: Jost Berthold <jost.berthold@digitalasset.com>

* Accidentally left in a testing change.

* Documenting DocCtx fields

* Mark new options internal
2019-08-05 13:23:58 +00:00
Moritz Kiefer
4a265e5399 Enable TypeApplications in daml-lf-ast.cabal (#2395)
We started using this recently which broke the cabal build.
2019-08-05 12:55:44 +00:00
Moritz Kiefer
705f014a88 Fix daml build for usernames with spaces (#2392)
* Fix daml build for usernames with spaces

This PR fixes two issues caused by having spaces in your username:

1. On Windows, we need to quote the path to the daml binary in the
batch wrapper (quotes are not valid in usernames, so no need to worry
about escaping them).

2. Invoking ghc-pkg via callCommand broke since shells are
terrible. Luckily, we can easily get away with just using callProcess
here.

* Update compiler/damlc/lib/DA/Cli/Damlc.hs

Co-Authored-By: associahedron <231829+associahedron@users.noreply.github.com>
2019-08-05 08:49:40 +00:00
Moritz Kiefer
482a01dacf
Speed up dependency chasing (#2383)
This PR moves as much work as possible to GetLocatedImports which
contracry to GetDependencyInformation is shared between rules.

It’s still slower than it should be and somewhat messy but at least
it’s slightly faster and imho cleaner than before.
2019-08-05 09:31:14 +02:00
Rohan Jacob-Rao
9527fd044d Test template level let with keys (#2387) 2019-08-02 21:17:56 +00:00
associahedron
7d165a7511 damldocs: Switch to mustache templates. (#2373)
* damldocs: Switch to mustache templates.

* Update cli help and release notes.

* Move to stache
2019-08-02 13:52:38 +00:00
Moritz Kiefer
393aa14e11
Make --shake-profiling use the directory based profiling (#2378)
* Make --shake-profiling use the directory based profiling

The single-file based profiling is rather useless in the IDE and I
always found myself having to modify the source to set `profileDir` so
this PR switches the CLI option to control that instead.

* Add --shake-profiling to damlc ide
2019-08-02 15:21:40 +02:00
Anup Kalburgi
6f8edb86b1
Visual Checking actual actions instead of number of actions
Visual Checking actual actions instead of the number of actions
2019-08-01 18:25:04 -04:00
Martin Huschenbett
7cebdb7c17 Shrink stack size on Windows in bond memory test (#2358)
We increased it by too much in order to get tests to pass earlier. Now we shrink it to something closer to what we had before.
2019-08-01 13:45:27 -04:00
Anup Kalburgi
e5a0206a62
Visual tests - Avoid using golden file tests (#2325) 2019-07-31 15:49:53 -04:00
Neil Mitchell
6dd5e04576 Fix up the .ghci file for hie-core to track recent changes (#2322) 2019-07-31 21:15:40 +02:00
associahedron
35ee96a613 damldocs: Unify output across formats. (#2351)
* Unify rst and md output in damldocs.

* Fix errors

* Define RenderUnwords / RenderIntercalate in terms of RenderConcat

* Delete the old

* Small output format changes and update golden tests

* Fix table rendering and tests.

* Fix golden test.

* Delete more old

* Implement reviewer suggestions
2019-07-31 17:34:52 +00:00
Robin Krom
8fe537e292
Dar building cleanup (#2357)
* reorganizing dar building
2019-07-31 18:34:41 +02:00
Gary Verhaegen
0c154b7948 add set -e to vsix production (#2359) 2019-07-31 15:10:30 +00:00
Moritz Kiefer
72695ec310 Optimize mangleIdentifier (#2350)
* Optimize mangleIdentifier

I am slightly embarassed by importing Data.Text.Internal and
Data.Text.Array. However, this does make a very measurable difference:
On my testcase it brought down the time encoding modules from 22s to
17s, so it’s a 5s improvement.

I did quickcheck this against the old implementation, so I’m confident
it behaves correctly. I also ran some criterion benchmarks to see the
difference and on its own it’s even more of a difference.

https://gist.github.com/cocreature/822114257227473ecff1638a88f07788

* GHC is stupid :(
2019-07-31 14:07:36 +00:00