Commit Graph

10 Commits

Author SHA1 Message Date
Simon Jakobi cd49b65c23 Move HsYAML-based code to new package dhall-yaml (#1514)
* Shared code for the dhall-to-yaml[-ng] executables stays in dhall-json.
* Shared tests are in dhall-yaml.

Fixes #1435.
2019-11-07 12:11:04 +00:00
Patrick Mylund Nielsen 96e694d7c6
'gpl' cabal flag to switch between HsYAML and aeson-yaml (#1417) 2019-10-15 03:12:12 -04:00
Jack Henahan 7080883af3 Make sure `dhall-nix` is included in releases (#1340)
Saw on Slack that the Darwin release was missing for `dhall-to-nix`, and from what I've dug up it looks like this should fix that.
2019-09-24 14:19:50 -07:00
Frederik Ramcke d5d0224bc3 Preparing `Dhall.Import` for "Semi-semantic" caching (#1113)
* Fix misleading comment

* Add `Chained` type to capture fully chained imports

Until now we used `Import` two mean two different things:
- The syntactic construct; e.g. `./a.dhall` corresponds to the following
  AST:
  ```
  Embed
    (Import
      (ImportHashed Nothing (Local Here (Directory ["."]) "a.dhall"))
      Code)
  ```

- The physical location the import is pointing to, computed by
'chaining' the syntactical import with the the 'physical' parent import.
For example the syntactic import `./a.dhall` might actually refer to the
remote file `http://host/directory/a.dhall`.

This commit adds a `Chained` newtype on top of `Import` to make this
distinction explicit at type level.

* Use `HTTPHeaders` alias for binary headers

I claim that `HTTPHeaders` is more readable and informative than the
unfolded type `(CI ByteString, ByteString)`.

* Typecheck and normalise http headers earlier

Previously we would typecheck and normalise http headers in
`exprFromImport`, i.e. while loading the import. This commit adds the
invariant that any headers in 'Chained' imports are already typechecked
and normalised, and moves this step into `loadWith` accordingly.

This causes a subtle difference in behaviour when importing remote files
with headers `as Location`: previously, nonsensical expressions like
`http://a using 0 0 as Location` were valid, while they would now cause
a type error.

* Fix dhall-lsp-server

* Fix Dhall.Import API regarding `Chained` imports

Do not expose the `Chained` constructor; we don't want external code
breaking our invariants! Also further clarifies the comment describing
the `Chained` type.

* Fix dhall-lsp-server

Since we are no longer able to construct `Chained` imports directly we
need to export a few additional helper functions from Dhall.Import.
Furthermore, since VSCode (and presumably the other editors out there
implementing the LSP protocol) does not support opening remote files
anyway we can get rid of some complications by dropping support for
remote files entirely on the back-end.

* Generalise decodeExpression, fixes TODO

* Fix tests

* Fix benchmarks

* Remove Travis cache for `~/.local/bin`

* Fix copy-pasted comment

Thanks to @Gabriel439 for spotting this!

* Add clarifying comment to `toHeaders`
2019-07-17 15:20:48 +00:00
Fabrizio Ferrai 0506c13822
Build macOS binaries with Travis (#1101) 2019-07-15 09:43:59 +03:00
Tobias Pflug 6029f25b94 Make format and dhall subcommands of dhall executable (#452) 2018-06-10 19:54:22 +02:00
Hardy Jones 755f91b6e0 Deploy binaries to GitHub Releases (#181)
This should build on OSX as well as Linux.
When there is a git tag, the build should create a Release on GitHub.
The Release should have the built binaries for OSX and Linux.
2017-11-20 16:30:11 -08:00
Gabriel Gonzalez 47849e3fca Drop support for GHC 7 (#106)
The main motivation for this change is to take advantage of new features in
GHC 8.  Dropping support for GHC 7 seems reasonable given that even Debian
stable is on GHC 8
2017-08-23 20:35:31 +03:00
Gabriel Gonzalez 878eccd65e Only support GHC 7.10 or newer
Dhall depends on `Numeric.Natural` which was first added in `base-4.8`, which
ships with `ghc-7.10`
2016-12-04 13:44:15 -08:00
Gabriel Gonzalez d9c3fc15dc Add Travis configuration 2016-12-04 13:18:43 -08:00