Commit Graph

89 Commits

Author SHA1 Message Date
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
Simon Jakobi
482984eb6d Allow only valid HTTP(S) reg-names (#1124)
Corresponding change to the standard:
https://github.com/dhall-lang/dhall-lang/pull/627

The potPourri parser test remains disabled due to
https://github.com/dhall-lang/dhall-lang/pull/655.

Fixes https://github.com/dhall-lang/dhall-haskell/issues/1110.
2019-07-20 00:54:27 +00:00
quasicomputational
0df6362a9d Make the tests build with GHC 7.10. (#1134) 2019-07-18 23:11:51 +00:00
Simon Jakobi
40ec83743d Make isNormalized consistent with normalize (#1115)
To be more precise (citing the haddocks):

    Given a well-typed expression e, (isNormalized e) is equivalent to
    (e == normalize e).

    Given an ill-typed expression, isNormalized may return True or False.

An even closer correspondence between isNormalized and 'normalize' is
currently tricky to achieve as 'normalize' returns errors only for some
ill-typed expressions. Once 'normalize' is more principled in this
regard, isNormalized could be changed to return a (Maybe Bool).

This re-enables a property test checking this consistency. Since
'normalize' returns errors for some ill-typed expressions, we
catch have to catch these, which requires an NFData for Expr.
2019-07-17 22:19:41 +00:00
Gabriel Gonzalez
462f82a0f8 Build against optparse-applicative-0.15 (#1081)
Related to https://github.com/commercialhaskell/stackage/issues/4693
2019-07-07 11:49:11 +00:00
Simon Jakobi
f873b0d66e Increase coverage of acceptance tests (#1072)
* dhall:tasty: Unskip a few tests

These remain broken:

- tests/parser/failure/annotation
- tests/parser/failure/missingSpace
- tests/parser/failure/unit/ImportEnvWrongEscape
- tests/parser/failure/unit/ListLitEmptyAnnotation
- tests/parser/failure/unit/ListLitEmptyPrecedence
- tests/parser/success/unit/MergeParenAnnotation

* Typo

* Add binary-decode failure tests

A few pass, but these are broken:

- tests/binary-decode/failure/unit/ApplyNoArgs
- tests/binary-decode/failure/unit/LambdaExplicitlyNamedUnderscore
- tests/binary-decode/failure/unit/NaturalNegativeOne
- tests/binary-decode/failure/unit/PiExplicitlyNamedUnderscore
- tests/binary-decode/failure/unit/VariableExplicitlyNamedUnderscore

* dhall:tasty: Add semantic-hash tests
2019-07-07 11:00:55 +00:00
Simon Jakobi
15e981f61c
Fix benchmarks, run them on AppVeyor (#1033)
Since we only want to ensure that the benchmarks continue to
work, we use the following benchmark arguments to run them
as quickly as possible:

- `--quick` ensures that gauge runs only a single sample.
- `--min-duration=0` sets the number of iterations per sample to 1.
- `--include-first-iter` causes gauge to accept that one iteration
  instead of discarding it and running a second one.

This also removes the dhall-command benchmark:

This was a non-standard benchmark that failed when run
without input from stdin. To replace this profiling tool,
I have added instructions for profiling the main executables
to the README.
2019-07-01 12:52:43 +02:00
Simon Jakobi
7647adba1a
Speed up Dhall.Map.unorderedTraverseWithKey_ (#1036)
This reduces the runtime of the `deep-nested-large-record` benchmark by about 50%.

Note that previously, contrary to its name and documentation, this function traversed a Dhall.Map in insertion order due to its use of Dhall.Map.toList! With this change, the traversal is changed to ascending key order.

Also:
- Fix the deep-nested-large-record benchmark

- Remove the map-operations benchmark: This benchmark actually reports a ~20% loss of performance for the unorderedTraverseWithKey_ change.  Since we eventually care about dhall's performance we it's better not to be mislead by a questionable micro-benchmark.
2019-06-30 19:54:13 +02:00
Dmitry Dolgov
0bf4e41020 Fix appveyor tests (#1037)
Fixes #1034

Fixes the `import/success/hashFromCache`  test on Windows

Disables currently broken dhall-lsp-server tests
2019-06-30 14:35:55 +02:00
Simon Jakobi
57aab91241 Replace criterion with gauge (#1035)
This reduces build times for the benchmarks.
2019-06-27 09:41:42 -07:00
Simon Jakobi
8285625156
Add type-inference tests (#1023)
Closes #1021.
2019-06-27 07:23:24 +02:00
Clément Delafargue
b9aeb345e4 Make the type of extract richer (#1011)
see #387
2019-06-24 07:22:35 -07:00
Frederik Ramcke
dc5f70011d dhall-lsp-server: (new feature) annotate lets (#1014) 2019-06-20 09:37:59 -07:00
Gabriel Gonzalez
b001a61a02
Minor fix to dhall diff (#1006)
`dhall diff` slightly misbehaves when diffing the following expression with
itself:

```dhall
λ(f : List Bool -> Bool) → f ([] : List Bool)
```

... producing the following diff:

```
  λ(… :   …
        → …)
→ …@…
  - [ … ] : List …
  + [ … ] : List …
```

This is because there are two places in the `Dhall.Diff` module responsible
for comparing lists:

* Once in `diffApplicationExpression`, which compares two lists with at least
  one type annotation between them
* Once in `diffPrimitiveExpression`, which compares two lists if neither one has
  a type annotation

Those cases exhaustively cover all possible pairs of lists, but there was a
third (incorrect) fallback case that prematurely gave up and displayed them as
different.  This fallback would trigger when applying a function to an empty
list, since the diffing algorithm wouldn't have a chance to return back to the
top-level `diffExpression` and try to compare the lists correctly in
`diffApplicationExpression`.

After this change, the diff now doesn't include a spurious difference:

```
  λ(… :   …
        → …)
→ …@…
  …
```
2019-06-14 09:43:30 -07:00
Gabriel Gonzalez
154d1c52cf
Remove support for old-style List-like Optional literals (#1002)
... as standardized in https://github.com/dhall-lang/dhall-lang/pull/572
2019-06-13 17:59:49 -07:00
Gabriel Gonzalez
fc5b382238
Version 1.23.0 → 1.24.0 (#984) 2019-06-06 17:14:43 -07:00
Gabriel Gonzalez
26bb77e99e
Move lens-like utilities to Dhall.Optics module (#986) 2019-06-05 20:18:42 -07:00
Gabriel Gonzalez
e8ac5e3bd0
Add new --cache flag to dhall freeze (#980)
Part of https://github.com/dhall-lang/dhall-lang/issues/563

This flag freezes imports in the same way as the Prelude by providing a
fallback unprotected import without an integrity check.  The primary use
case for this is caching imports with a graceful fallback, which is why
the flag is named `--cache`
2019-06-01 09:44:01 -07:00
Gabriel Gonzalez
8dc52fa3d2
Add support for improved using behavior (#967)
... as standardized in https://github.com/dhall-lang/dhall-lang/pull/560
2019-06-01 08:27:26 -07:00
Gabriel Gonzalez
d788b780a2
Update to latest version of language standard (#948)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/947
2019-05-13 08:23:46 -07:00
Gabriel Gonzalez
bf4349ef7a
Version 1.22.0 → 1.23.0 (#943) 2019-05-11 13:03:42 -07:00
Stephen Paul Weber
2fc7f79959 Reduce dependency requirements to what is in sid (#939)
This make it easier to build the package on debian unstable, which is
the first step towards an official package.
2019-05-05 07:54:14 -07:00