Commit Graph

1078 Commits

Author SHA1 Message Date
Gabriel Gonzalez
89817b41fd
Build docker images for each package in CI (#950)
Fixes #513
2019-05-13 10:37:03 -07:00
Gabriel Gonzalez
20f6d8c316
Add --file flag (#949)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/882

This allows users to supply the Dhall expression by path instead of via
standard input.  This also ensures that transitive imports are resolved
appropriately relative to the file's path.

In other words, instead of this:

```
$ dhall <<< './foo/bar.dhall'
```

Users can now do:

```
$ dhall --file foo/bar.dhall
```
2019-05-13 09:26:38 -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
dadade9dd8
Fix linting tests to only test linting (#945)
The tests were unnecessarily attempting to resolve imports, which is
orthogonal to linting
2019-05-13 07:01:04 -07:00
Gabriel Gonzalez
8139c3678c
Change YAML/JSON encoding for NaN/Infinity/-Infinity (#946)
Before, `dhall-to-json`/`dhall-to-yaml` would use approximate
representations for special `Double` values.  Specifically, `NaN`
would encode as `null` and `±Infinity` would encode as the minimum
and maximum `Double` values.

After this change, YAML will now use `nan`/`inf`/`-inf` to encode
these values (since special `Double` values are natively supported
by YAML) and the JSON encoding will reject them by default.  The
user can restore the old behavior for the JSON encoding by enabling
the `--approximate-special-doubles` flag.
2019-05-12 16:04:25 -07:00
Dmitry Dolgov
07906673af [POC] Add 'quoted' option (#941)
Allow to generare quoted scalars if needed via providing a custom encode
options to Data.Yaml.encodeWith. So far two corner cases from yaml
itself (an empty scalar, and special strings) are omitted in the
implementation.
2019-05-12 07:44:12 -07:00
Gabriel Gonzalez
bf4349ef7a
Version 1.22.0 → 1.23.0 (#943) 2019-05-11 13:03:42 -07:00
Robbie McMichael
2530207abb Set syntax highlighting for Dhall files (#942) 2019-05-07 09:13:19 -07:00
quasicomputational
48c73f3ef9 Add and expose genericInject. (#940)
This is a counterpart to `genericAuto`, which is useful for dealing
with types coming from a library without orphan instances.
2019-05-05 20:21:50 -07:00
Gabriel Gonzalez
7d56778350
Fix another α-normalization bug (#938)
This was caught by the following test:

372230d161/tests/alpha-normalization/success/unit/FunctionNestedBindingXXFreeA.dhall
2019-05-05 19:30:26 -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
Gabriel Gonzalez
a929d4e0bb
Fix marshalling of unions (including enums) in and out of Dhall (#936)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/930
2019-05-04 22:29:51 -07:00
Basile Henry
29ccd7d0cb Fix repl autocomplete for Records and Unions (#937) 2019-05-04 12:13:09 -07:00
klntsky
74fcafe5d3 dhall freeze subcommand should respect --ascii flag (#934)
Fixes #877
2019-05-03 13:44:59 -07:00
Greg Pfeil
1073d04b82 Fix merging of sort-level record types. (#891)
Fixes #890
2019-05-03 08:50:23 -07:00
AndrasKovacs
931dc50522 Fix alpha normalization (#931)
Fixes #929
2019-05-02 13:50:17 -07:00
quasicomputational
c9ea8b99ca Teach genericAuto about new-style union construction. (#927)
The underlying bug is very similar to #915, and in fact this builds on
the fix for that in #918.

Closes #926.
2019-05-02 09:26:53 -07:00
Vanessa McHale
8fa233336d Add 'cross' flag to simplify cross-compilation (#928)
Co-Authored-By: vmchale <vmchale@users.noreply.github.com>
2019-05-02 08:21:39 -07:00
quasicomputational
66df01b26c
Remove stack-lts-11.yaml. (#922)
It had bitrotted and wasn't presently building; evidently no-one was
missing it. LTS 6 is actively checked by CI, so while this loses some
coverage of dependency versions in the middle of the range, it doesn't
shrink the overall range of dependencies tested.

Closes #921.
2019-05-01 20:40:13 +01:00
quasicomputational
4f9defec25 Use MonadFail.fail, not Monad.fail. (#912)
Monad.fail is no more with GHC 8.8, so this is a forced change.
However, it will also work on older GHCs.
2019-05-01 11:22:39 -07:00
klntsky
962a172b53
Converted sample code to doctest for RecordType, UnionInputType, RecordInputType 2019-05-01 09:52:43 +03:00
Gabriel Gonzalez
6d510ee2b1
Add line numbers to error messages (#919)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/905

For example, this file:

```haskell
[ 1
, 2
, 3
, Bool

+ 1
]
```

... now produces this error message:

```
Use "dhall --explain" for detailed errors

↳ ./example.dhall

Error: ❰+❱ only works on ❰Natural❱s

4:   Bool
5:
6:
7:
8:
9: + 1

/Users/gabriel/proj/dhall-haskell/dhall/example.dhall:4:3
```
2019-04-30 15:31:18 -07:00
Gabriel Gonzalez
d69ac6599f
Fix CHANGELOG for version 1.22.0 (#917)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/914

This mentions breaking changes that were part of implementing verison 7.0.0
of the standard
2019-04-30 12:13:22 -07:00
Gabriel Gonzalez
d1501b51f9
Increase lines of context for error messages (#916)
Related to https://github.com/dhall-lang/dhall-haskell/issues/905

This increases the size of expressions that we display in error messages to
20 on each side before we begin truncating the output
2019-04-30 10:55:00 -07:00
Gabriel Gonzalez
684cbac7be
Uncomment line from .cabal file (#909) 2019-04-30 09:31:54 -07:00
Gabriel Gonzalez
07c9c62af3
Fix marshaling new-style union literals (#918)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/915
2019-04-30 08:18:12 -07:00
Gabriel Gonzalez
44a2750ca0
Explain use case for dhall-to-nix (#913)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/902
2019-04-27 21:10:02 -07:00
Gabriel Gonzalez
f7fecda09d
Version 1.21.0 → 1.22.0 (#910) 2019-04-27 20:17:34 -07:00
Ollie Charles
d3d7baf3e5
dhall-nix: Fix field-based union access (#907)
Fixes #906.

This adds new translation rules:

* <Foo : {} | Bar>.Foo => x: { Bar, Foo }: Foo x

* <Foo : {} | Bar>.Foo {=} => { Bar, Foo }: Foo {}

* <Foo : {} | Bar>.Bar => { Bar, Foo }: Bar
2019-04-27 11:17:01 +01:00
Gabriel Gonzalez
21da6f2b7f
Update to latest test suite (#903)
This requires implementing the following changes to the standard:

* https://github.com/dhall-lang/dhall-lang/pull/481
* https://github.com/dhall-lang/dhall-lang/pull/488
* https://github.com/dhall-lang/dhall-lang/pull/489
* https://github.com/dhall-lang/dhall-lang/pull/497
2019-04-25 15:05:02 -07:00
Gabriel Gonzalez
7d31506be4
Automatically discover tests (#897)
This adds a new `Dhall.Test.Util.discover` utility for auto-generating
a `TestTree` from a directory tree.  This simplifies keeping up to date
with changes to the standard test suite.
2019-04-24 13:01:46 -07:00
Profpatsch
86ceb825cd dhall-json: Rephrase error message when decoding a bare None (#900)
Co-Authored-By: Profpatsch <mail@profpatsch.de>
2019-04-23 08:43:00 -07:00
antislava
f462dcc90a
shell.nix with the core Dhall tools (#899)
* shell.nix with the core Dhall tools

* Inheriting 'pkgs' from ./nix/shared.nix. Meaningfull welcome message with
usage examples.

* Update shell.nix

Co-Authored-By: antislava <antislava@gmail.com>

* Update shell.nix

Co-Authored-By: antislava <antislava@gmail.com>

* Top-level nix-shell mention in README.md
2019-04-19 22:16:52 +02:00
Gabriel Gonzalez
1f40b633d6
Add a better error message when decoding a bare None (#895)
Fixes #492
2019-04-19 09:30:05 -07:00
AndrasKovacs
fcca883e00 Add a new environment machine normalizer (#876)
- Dhall.Eval: new evaluator, conversion checker and normalizer.
  There is no standalone alpha normalizer yet.
- There is a new option "new-normalize" for dhall executable, which uses
  the new normalizer.
- Type checker is unchanged.
- new implementation: alphaNormalize, judgmentallyEqual, normalize
- normalizeWith takes a Maybe ReifiedNormalizer argument now, and switches to
  the new evaluator whenever the input normalizer is Nothing
- QuickCheck test for isNormalized removed, because we don't support evaluation
  of ill-typed terms, which the test would require.
2019-04-17 16:41:04 -07:00
Javier Neira
91f3cae1bf Add json-to-dhall to appveyor artifacts (#894)
* Add json-to-dhall to dhall-json artifact

* Make json-to-dhall buildable with ghc-7.10

* Remove commented buildable field

* Remove unused import Semigroup
2019-04-16 12:52:55 +02:00
Javier Neira
af2c02cf28
Make lts-12 the default stack configuration in appveyor to avoid build timeouts (#893)
* Use lts-12
* Remove cache on fail and add workaround to fix build with stack
* Add dhall-lsp-server to lts-12
* Commenting out default stack.yaml
* Bump up megaparsec version
2019-04-16 07:33:32 +02:00
antislava
c52ae96a0b
json-to-dhall initial implementation (#884)
* Initial draft of the json-to-dhall tool

* Homogenous JSON maps -> Dhall association lists. Bower example.

* Default conversion options. Ghci examples in function annotations.

* Added type signature to text color highlighting functions (error
reporing)

* Removed TypeApplications extension

* Explicit semigroups

* Disable ghc < 8.0 build

* Type specifications for 'None's (e.g. None Integer instead of just None)

* New style for unions, e.g.: < Left : Text | Right : Integer >.Right +1
2019-04-15 01:21:38 +02:00
Stephen Paul Weber
d0fb71b0ba Add dhall-ruby to website (#892)
Co-Authored-By: singpolyma <singpolyma@singpolyma.net>
2019-04-13 21:08:34 -07:00
Javier Neira
0804689da1 Update tests and include dhall-lsp-server in appveyor (#889) 2019-04-11 16:47:07 -07:00
Gabriel Gonzalez
f4542d5bc5
Integrate dhall-nix into CI (#887) 2019-04-11 09:16:43 -07:00
Gabriel Gonzalez
505bd9240d
Merge pull request #886 from dhall-lang/gabriel/dhall_nix
Merge `dhall-nix` into `dhall-haskell`
2019-04-10 06:42:07 -07:00
Gabriel Gonzalez
b59540342e Merge remote-tracking branch 'dhall-nix/master' into gabriel/dhall_nix 2019-04-09 17:33:02 -07:00
Gabriel Gonzalez
8b6bd4950a
Disable tests for dependencies (#883)
This no longer tests dependencies, mainly to lower my maintenance burden.  In
particular, this makes it easier for me to test bumping dependencies for
Stackage-related bounds changes.
2019-04-09 08:13:41 -07:00
Profpatsch
6c38bd89ea Update to dhall > 1.19 (#19)
Some things have changed in the dhall expression tree:

- `let` bindings now take a list of bindings
- `Some` and `None` were introduced
- `Text/show` was added

Additionally, dhall switched to an internal `Map` module instead of
`HashMap.Strict.InsOrd`.

Closes: https://github.com/dhall-lang/dhall-nix/issues/18
2019-04-09 06:59:01 -07:00
Fabrizio Ferrai
58ae94df0e
Fix typechecking of Sorts in records (#881)
As standardized in dhall-lang/dhall-lang#453
2019-04-07 14:50:49 +03:00
Gabriel Gonzalez
ba55d55307
Add support for fields named after built-ins (#875)
... as standardized in https://github.com/dhall-lang/dhall-lang/pull/437
2019-03-30 11:50:26 -07:00
Gabriel Gonzalez
6cbd9f2b68
Update to reflect new test organization (#874)
... as standardized in https://github.com/dhall-lang/dhall-lang/pull/443
2019-03-30 10:57:44 -07:00
Gabriel Gonzalez
5c690f9ca1
Add enum support to dhall-bash (#873)
... as mentioned here: https://github.com/dhall-lang/dhall-haskell/issues/97#issuecomment-477699974

Similar to `dhall-json`, this translates empty alternatives to
strings of the same name
2019-03-30 10:14:33 -07:00
Fabrizio Ferrai
e44a6e0055 Also omit empty arrays with --omitEmpty (#872) 2019-03-30 09:43:48 -07:00