Commit Graph

110 Commits

Author SHA1 Message Date
Gabriel Gonzalez 4c7b75b503
Version 1.27.0 → 1.28.0 (#1575) 2019-12-05 19:28:39 -08:00
Simon Jakobi 8d3c4e4250 Allow megaparsec-8 (#1582)
This also officially removes support for megaparsec-6.5 – the
build had been broken before though.
2019-12-03 03:28:06 +00:00
Simon Jakobi 96ae330fb5 Allow hashable-1.3 (#1581) 2019-12-02 17:27:21 +00:00
Gabriel Gonzalez 780aa94612
Permit spaces around completion operator (#1532)
... as standardized in https://github.com/dhall-lang/dhall-lang/pull/820
2019-11-23 18:45:04 -08:00
Simon Jakobi feb378b8da Add an internal "dhall haskell-syntax-tree" command (#1553)
… for debugging.
2019-11-22 03:57:14 +00:00
Simon Jakobi 3b222cda91 Write cache files atomically (#1544)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/1540.
2019-11-22 00:49:46 +00:00
Simon Jakobi dedd5e0ea6
Strip trailing whitespace (#1422)
This raises the lower bound on prettyprinter to 1.5.1 since
`removeTrailingWhitespace` is buggy in earlier versions.

This jailbreaks hnix, which isn't compatible with prettyprinter-1.5.1 yet.

Fixes #183, #1400, #1525. 

Co-authored-by: Gabriel Gonzalez <Gabriel439@gmail.com>
2019-11-14 14:43:35 +01:00
Gabriel Gonzalez a0c3be9ca1 Fix import resolution performance regression (#1522)
* Fix import resolution performance regression

Related to https://github.com/dhall-lang/dhall-haskell/issues/1511

This fixes a performance regression introduced in #1159 where `newManager`
was being called on every remote import.  This fixes that by going back to
caching the `Manager` created by the first request.

This leads to *dramatic* performance improvements for import-rich packages
(like the Prelude or `dhall-kubernetes`) on the first import.  For example,
here are the performance numbers for importing the Prelude for a cold cache
before and after this change:

Before:

```
$ XDG_CACHE_HOME=.cache time dhall hash <<< 'https://prelude.dhall-lang.org/package.dhall'
sha256:99462c205117931c0919f155a6046aec140c70fb8876d208c7c77027ab19c2fa
       64.10 real        10.83 user         2.73 sys
```

After:

```
$ XDG_CACHE_HOME=.cache2 time dhall hash <<< 'https://prelude.dhall-lang.org/package.dhall'
sha256:99462c205117931c0919f155a6046aec140c70fb8876d208c7c77027ab19c2fa
        4.39 real         0.49 user         0.15 sys
```

That's ~16x faster!

The improvement for `dhall-kubernetes` is smaller, but still significant:

Before:

```
$ XDG_CACHE_HOME=.cache3 time dhall hash <<< ~/proj/dhall-kubernetes-charts/stable/jenkins/index.dhall
sha256:04ebd960f6af331c49c3ccaedb353ac8269032b54fe0a29bd167febcd7104d4f
      833.59 real       145.36 user        36.16 sys

After:

```
$ XDG_CACHE_HOME=.cache4 time dhall hash <<< ~/proj/dhall-kubernetes-charts/stable/jenkins/index.dhall
sha256:04ebd960f6af331c49c3ccaedb353ac8269032b54fe0a29bd167febcd7104d4f
      381.41 real         8.41 user         1.91 sys
```

... or ~2-3x improvement.

* Fix `-f-with-http` build

* Remove unnecessary `CPP`

... as caught by @sjakobi
2019-11-08 18:58:03 +00:00
Gabriel Gonzalez 7ea5f6fa51 Remove support for fusion (#1478)
* Remove support for fusion

... as standardized in https://github.com/dhall-lang/dhall-lang/pull/792

* Update `dhall.cabal` to match the latest Prelude

* Update `dhall-lang`

... and blacklist tests we don't support yet

* Add missing files to `dhall.cabal`
2019-11-01 05:33:05 +00:00
Simon Jakobi 8f2c28a5dc
Move normalization code from Dhall.Core to a new module Dhall.Normalize (#1452)
Also try to decouple a few modules from Dhall.Core.

Closes #1127.
2019-10-24 00:01:02 +02:00
Gabriel Gonzalez 7b414d9846
Version 1.26.1 → 1.27.0 (#1428) 2019-10-20 07:00:43 -07:00
Simon Jakobi a944d12591 Add --file option for `dhall hash` (#1445)
To use the existing utilities in Dhall.Main more easily, I have moved
the implementation to Dhall.Main.
2019-10-19 22:38:44 +00:00
Simon Jakobi bec6ce610f Move syntax things from Dhall.Core to a new module Dhall.Syntax (#1440)
This partially addresses #1127.
2019-10-19 20:13:22 +00:00
Simon Jakobi b75962a405 Use a more conventional spelling for "etags", mostly just use "tags" (#1432)
The previous "ETags" spelling was likely to cause confusion with HTTP ETags:
https://en.wikipedia.org/wiki/HTTP_ETag
2019-10-19 01:59:29 +00:00
Jie 1cd856a449 [#1392] Injecting Data.Map (#1412)
* [#1392] Injecting Data.Map

* injecting via Generic

* Explicit instance

* Cleanup code

* Minor code cleanup

* Property testing for Inject/Interpret

* Refactor test

* Adding TypeApplications to .cabal

* No more TypeApplications

* Simplified tests using extract

* Added test for Text amnf fixed Natural import

* Update dhall/dhall.cabal

Co-Authored-By: Simon Jakobi <simon.jakobi@gmail.com>

* Update dhall/dhall.cabal

Co-Authored-By: Simon Jakobi <simon.jakobi@gmail.com>
2019-10-15 11:27:29 +00:00
Gabriel Gonzalez 4b8b8cd730
Add new record completion operator (#1375)
... as standardized in https://github.com/dhall-lang/dhall-lang/pull/767
2019-10-11 08:26:51 -07:00
Jie 34f706ed93 [#1395] Marshalling Set and HashSet (#1405)
* [#1395] Marshalling Set and HashSet

* Update dhall/src/Dhall.hs

Co-Authored-By: Simon Jakobi <simon.jakobi@gmail.com>

* Update dhall/src/Dhall.hs

Co-Authored-By: Simon Jakobi <simon.jakobi@gmail.com>

* Added distinctList

* setFromDistinctList updates

* Doctests abour ordering

* both set and hashset can ignore or fail with duplicates

* Comments on instances

* Moved length computation deeper

* Little wibble

Co-Authored-By: Simon Jakobi <simon.jakobi@gmail.com>
2019-10-10 16:31:44 +00:00
Dima 5b8ae442c8 Add tags subcommand (#1398)
Fixes #370.
2019-10-10 16:16:20 +02:00
Simon Jakobi 5e7794c652
Update dhall-lang submodule (#1403)
This includes some simplifications/optimizations for the `ToTerm DhallDouble` instance.

Most notably we let `cborg` take care of the correct encoding of NaNs:
See `Codec.CBOR.Write.doubleMP`:
  977c0c0820/cborg/src/Codec/CBOR/Write.hs (L571-L573)
2019-10-07 10:39:59 +02:00
Simon Jakobi e04f5af952 Adjust test setup to acceptance test suite changes (#1367)
… from https://github.com/dhall-lang/dhall-lang/pull/758
and https://github.com/dhall-lang/dhall-lang/pull/763.
2019-10-03 00:37:07 +00:00
Simon Jakobi 7c91dd5f48 Fix Expr's Eq instance via a newtype wrapper for Doubles (#1347)
See the haddocks in Dhall.Core for details.

Fixes #1341.
2019-09-28 14:56:37 +00:00
Gabriel Gonzalez 5b136dfa2c
Version 1.26.0 → 1.26.1 (#1336) 2019-09-24 21:14:33 -07:00
Gabriel Gonzalez 328a6739a8 Build against `Diff-0.4.*` (#1343)
Related to https://github.com/commercialhaskell/stackage/issues/4842
2019-09-25 03:29:02 +00:00
Vanessa McHale fe748e2884
Dhall version (#1332)
* Add Dhall.Version module

* Add Paths_dhall to Autogen-Modules
2019-09-20 15:53:13 +00:00
Patrick Mylund Nielsen fa84b0dc19
Different with-http CPP check; fix remote imports in GHCJS (#1330)
Completes the changes in #1311
2019-09-20 10:44:15 -04:00
Ollie Charles 8ead6012e9 dhall: Support GHC 8.8 (#1324) 2019-09-19 14:14:54 +00:00
Simon Jakobi fddce0b8cf Adjust type-checking test setup (#1275)
… in response to https://github.com/dhall-lang/dhall-lang/pull/723.
2019-09-15 02:56:16 +00:00
Patrick Mylund Nielsen c29b128339
Improve GHCJS support (cabal build, SHA256 hashing) (#1311) 2019-09-13 11:42:55 -04:00
Gabriel Gonzalez 65710954cf
Version 1.25.0 → 1.26.0 (#1286) 2019-09-11 19:37:25 -07:00
Gabriel Gonzalez 4458cf04a2 Simplify recursive `Interpret` instance (#1298)
* Simplify recursive `Interpret` instance

Related to https://github.com/dhall-lang/dhall-haskell/issues/1297

The motivation behind this change is to:

* Remove the dependency on `free` and `distributive`
* Simplify the API and the implementation

* Fix `stack-lts-6` build

* Remove now-unused test files

... as caught by @sjakobi
2019-09-11 03:24:10 +00:00
Gabriel Gonzalez 70948b3cba
Build against `profunctors-5.5.*` (#1299) 2019-09-10 18:39:11 -07:00
Simon Jakobi d1d0b3d462 Get rid of some CPP by upgrading to generic-random-1.3 (#1292) 2019-09-08 18:42:22 +00:00
Gabriel Gonzalez 04956193e9 Build against `ansi-terminal-0.10.*` (#1287) 2019-09-07 14:06:57 +00:00
Vanessa McHale eef23eb229 Bump memory (#1285) 2019-09-06 19:56:26 -05:00
Simon Jakobi 71bb56931d Use generic-random for Expr's Arbitrary instance (#1282)
Full coverage of all Expr constructors is now checked by the
type-checker. This revealed that that the IntegerToDouble, TextShow,
Some and None constructors were missing.

Also:
* Increase frequency for Lam, Pi and App
* Fix a few inconsistencies in normalization
* Remove some dead code in D.T.QuickCheck

Closes #1256.
2019-09-06 18:05:51 +00:00
Ollie Charles 287752563f Restore support for records containing both types and terms (#1173)
... as standardized in https://github.com/dhall-lang/dhall-lang/pull/689
2019-08-31 13:35:26 -05:00
Gabriel Gonzalez dbcfe7019d Fix `Inject` instance for lists (#1261)
* Fix `Inject` instance for lists

Fixes #1254

This also adds tests for conversions back and forth between Dhall and
Haskell values

* Add `Inject` instances for `Scientific` and `String`

... so that we don't need to comment them out!
2019-08-30 04:15:43 +00:00
Gabriel Gonzalez 4445eee871 Use `tasty-expected-failure` (#1250)
* Use `tasty-expected-failure`

... to exercise tests that we currently skip

Fixes https://github.com/dhall-lang/dhall-haskell/issues/1245

* Fix bounds syntax for `tasty-expected-failure`

... as caught by @sjakobi

Co-Authored-By: Simon Jakobi <simon.jakobi@gmail.com>

* Fix GHC 8.6 build failure

`tasty-expected-failure` needs to be bumped to include revision 1, which
supports GHC 8.6

* Fix build failure for older `tasty-hunit` versions

`tasty-hunit-0.9.2` and older have the wrong type for `assertFailure`

* Fix `stack` build for LTS 6

... and sort the list of `extra-deps`
2019-08-30 03:31:19 +00:00
Philip Potter 06dc9ab55f [dhall format] Prefer unquoted URLs (#1235)
* [dhall format] Prefer unquoted URLs

This updates `dhall format` to prefer unquoted URLs.

I included the test cases described in #1109, but along the way I
discovered a standard bug so I have opened dhall-lang/dhall-lang#704 to
fix it.  This change depends on that upstream fix.

Fixes #1109.

* pull in latest dhall-lang

* skip unimplemented tests
2019-08-22 21:28:26 +00:00
Simon Jakobi 93711aecf8 Throw error when union value is incompatible with Inline nesting (#1226) 2019-08-20 03:12:16 +00:00
MaxOw ec8bcf0d63 Add autoWithFix helper function for Interpreting recursive data types (#1161) (#1195)
* Add autoWithFix helper function (#1161)

* Fix some dependencies. Remove TypeApplications extension.

* Pin recursion-schemes to appease hydra.

* Implement review suggestions.

* Fix error in documentation.
2019-08-09 20:09:09 +00:00
Ollie Charles ae788fde89 Add bounds to either dependency (#1202)
`ealt` (which we use) is only available from version 5 up.
2019-08-06 00:48:48 +00:00
Ollie Charles 4a93c255db Remove Dhall.X and replace with Data.Void (#1172)
* Remove Dhall.X and replace with Data.Void

This commit removes the Dhall.X module and the Dhall.X.X type,
preferring the use of Data.Void.Void. As I'm sure a lot of people are
actually using X, I've added a type-alias type X = Void. However,
pattern matching on X would be a breaking change.

Fixes #1120.

* Restore unsafeCoerce

* Fix regression

* Unused

* Reorganise exports

* Fix dhall-nix

* Another fix

* Fix Dhall.LSP.Backend.Typing

* Fix dhall-bash
2019-08-05 13:00:59 +00:00
Simon Jakobi 2cf6a1ba74
Update dhall-lang to latest master (#1200)
…to fix build failures due to the submodule pointing at an unreachable commit.

* Disable a currently failing testcase.
* Update the extra-source-files in dhall.cabal.
2019-08-05 02:16:41 +02:00
Gabriel Gonzalez 7f2f57f975
Add support for dependent types (#1164) 2019-08-03 21:38:01 -07:00
Gabriel Gonzalez d45f3ec46b
Version 1.24.0 → 1.25.0 (#1156) 2019-07-28 21:46:32 -07:00
Frederik Ramcke fd8683216d Fix tests without `with-http` flag (#1159)
* Allow customization of remote import resolution

Makes the `Status` type more general; previously support for
`Network.HTTP.Client` was hardcoded. In short:

```
data Status = Status
    { _stack :: NonEmpty Chained
    [...]
--  , _manager :: Maybe Dynamic
--  --   importing the same expression twice with different values
++  , _remote :: URL -> StateT Status IO Data.Text.Text
++  -- ^ The remote resolver, fetches the content at the given URL.

    [...]
    }

```

* Simplify and expose `toHeaders`

`toHeaders` will be needed for mock http testing

* Fix compilation without `with-http` flag

* Fix compilation with `with-http` flag

* Fix tests without `with-http` flag

Implements a mock http client that handles requests to:
- `https://raw.githubusercontent.com/dhall-lang/dhall-lang/master/`
- `https://test.dhall-lang.org/Bool/package.dhall`
- `https://httpbin.org/user-agent`

This allows tests involving remote imports to succeed even when compiled
without the `with-http` flag.

* Build `dhall` with HTTP support compiled out in CI

... to prevent regressions from occurring in the future
2019-07-27 02:59:25 +00:00
Ollie Charles d55bf8f3a3 Add instance Lift (Expr s a) (#1119)
This allows Exprs to be lifted in template-haskell. This is useful to
build a [dhall||] quasiquoter
2019-07-21 12:10:53 -07:00
Simon Jakobi c8a0df3748 Specialize Expr's ToTerm instance to (Expr X a) (#1143)
* This simplifies pattern matching during encoding.
2019-07-21 15:17:41 +00:00
Gabriel Gonzalez cbd6a6543d Support `lens-family-core-2.0.0` (#1141)
Related to https://github.com/commercialhaskell/stackage/issues/4725
2019-07-20 12:18:49 +00:00