Commit Graph

23 Commits

Author SHA1 Message Date
Gabriel Gonzalez 8f3e913cde
Use git submodule to obtain official Prelude and test suite (#787)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/766
2019-01-19 09:09:34 -08:00
Gabriel Gonzalez f24f665047
Fix non-exhaustive pattern match in `dhall lint` (#780)
`dhall lint` would fail on the following expression:

```
    let replicate = https://prelude.dhall-lang.org/List/replicate

in  let Config = { name : Text, age : Natural }

in  let Configs = List Config

in  replicate 10 Text "!"
```

... because the code (incorrectly) assumed that simplifying an inner
`let` binding would preserve at least one `let` binding.  However, when the
outer `let` (beginning with `let replicate`) is simplified the inner `let`
(beginning with `let Config`) simplifies down to just `replicate 10 Text "!"`
which has no `let` binding at all, leading to a pattern match failure.

This change fixes that by extending the code to correctly handle that case
with an exhaustive pattern match.
2019-01-16 21:59:11 -08:00
Gabriel Gonzalez 3a315225d7
Build against `http-client-0.6` (#776)
Related to https://github.com/commercialhaskell/stackage/issues/4290
2019-01-16 20:09:37 -08:00
Javier Neira d481f47bed Add eta support and update stack config to lts-13 (#778) 2019-01-11 19:35:39 -08:00
Gabriel Gonzalez fc3472d085
Version 1.20.0 → 1.20.1 (#773) 2019-01-05 18:51:33 -08:00
Gabriel Gonzalez 6a70f133a1
Version 1.19.1 → 1.20.0 (#767) 2018-12-29 11:48:21 -06:00
Fintan Halpenny a95acd5b2a Add Unordered Map Traversal (#749) 2018-12-10 10:46:46 -08:00
Gabriel Gonzalez 6ab5df4d49
Implement standardized support for multi-line literals (#726)
... as standardized in https://github.com/dhall-lang/dhall-lang/pull/307

Note that this a breaking change because:

* Newlines are now mandatory after the opening `''` of a multi-line
  literal
* The spaces before the trailing `''` count towards the leading
  indentation computation
2018-12-08 08:49:08 -08:00
Gabriel Gonzalez cf69f5a953
Add "Try Dhall" project (#739)
This adds three new Nix build products:

* `try-dhall-static` - The static assets for "Try Dhall"
* `try-dhall-server` - A script which serves the static assets for local
   debugging
* `tarball-try-dhall` - A tarball of the static assets

This is powered by a new small `dhall-try` package which is also included
in this change.
2018-12-06 18:00:03 -08:00
Gabriel Gonzalez 83c4a32e99
Refactor test suite (#733)
This moves all of the test suite modules underneath a `Dhall.Test`
module hierarchy instead of clobbering the top-level namespace.
2018-12-03 09:17:53 -08:00
Gabriel Gonzalez 9148b35aba
Build against `tasty-1.2` (#731)
Related to https://github.com/commercialhaskell/stackage/issues/4196
2018-12-03 08:48:43 -08:00
Gabriel Gonzalez a671e9c2f5
Add `--json` flag for `dhall {decode,encode}` (#717)
Fixes #714

This adds a `--json` flag that `dhall decode` and `dhall encode` can use to
read/write the equivalent JSON representation of the CBOR.  This comes in
handy for the parsing compliance tests which use this CBOR-as-JSON as the
standard representation of the abstract syntax tree.
2018-11-28 17:51:20 -08:00
Gabriel Gonzalez 04e2dbfcaa
Version 1.19.0 → 1.19.1 (#705) 2018-11-27 00:09:00 -08:00
Gabriel Gonzalez 85ccf2ff0a
Improve HTTP error messages (#710)
Fixes #509

The `Dhall.Import.HTTP` module had logic for pretty-printing HTTP error
message, but this logic wasn't being used anywhere!  This change fixes
that and also polishes the error messages a little bit.
2018-11-26 07:53:22 -08:00
Basile Henry c8dc585430
Generate dot graph to visualize import graph (#698)
* Add dotgen as a dependency

Signed-off-by: Basile Henry <bjm.henry@gmail.com>

* Build up dot graph while resolving imports

Signed-off-by: Basile Henry <bjm.henry@gmail.com>

* Add --dot option to resolve in CLI

Signed-off-by: Basile Henry <bjm.henry@gmail.com>

* Handle diamond dependencies in dot graph

* Refactor dot graph generation
2018-11-26 07:24:20 +02:00
Gabriel Gonzalez 203a22818e
Fix bug when linting multi-`let` expressions (#703)
`dhall lint` was incorrectly deleting `let` bindings that are being used
due to not checking other `let` bindings within the same multi-`let`
expression for free variable occurrences.

This change fixes that and adds the first regression test for `dhall
lint`
2018-11-24 08:32:04 -08:00
Gabriel Gonzalez 53ae87c8e2
Version 1.18.0 → 1.19.0 (#691) 2018-11-21 19:10:32 -08:00
Gabriel Gonzalez 8bc595be7f
Add support for quoted path components (#690)
... as standardized in https://github.com/dhall-lang/dhall-lang/pull/293
2018-11-20 18:08:43 -08:00
Gabriel Gonzalez 8a74105007
Update tests to match the filesystem layout from the standard (#688)
This begins updates the filesystem layout for the tests to match
the new layout from the standard test suite (See:
https://github.com/dhall-lang/dhall-lang/pull/265)

This is still missing a part of the standard requirement, which is checking
parsing and import test results against an expected output (instead of
just checking that they succeed).  I plan to add that in a subsequent
pull request.  This is mainly to unblock other features that require using
the new standard layout.
2018-11-17 08:23:26 -08:00
Gabriel Gonzalez 96a360a5bc
Add lower bound to `optparse-applicative` (#685)
Fixes https://github.com/dhall-lang/dhall-lang/issues/282
2018-11-16 08:43:23 -08:00
Dan Burton 7aba79118c Use an Ordered Set for Project (#670) 2018-11-05 19:59:01 -08:00
Sofia Rose 9d0fd42d95 Fix parsing of //\\ (#666)
The issue was that the parser was attempting to parse // first, which
will succeed on the prefix of //\\, then the parser will get an error
because it expects a sub expression but the input is \\.
2018-10-29 20:28:50 -07:00
Gabriel Gonzalez aecfbc9acc
Migrate `dhall-{bash,json,text}` into this repository (#661)
The motivation for this change is:

* To catch build failures in downstream packages whenever we make a breaking
  change to the `dhall` API
* To reduce the amount of work I need in order to cut a release for all of
  these packages
* To better share Nix/CI-related logic between the projects

Note that I have not yet migrated `dhall-nix` in.  I'm waiting for
https://github.com/dhall-lang/dhall-nix/issues/17 to be fixed since
`dhall-nix` is incompatible with later versions of `megaparsec` due to
`hnix`.
2018-10-28 17:32:51 -07:00