Commit Graph

1149 Commits

Author SHA1 Message Date
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
Gabriel Gonzalez
fe5d100226
Fix parsing of identifiers that overlap with imports (#870)
Fixes https://github.com/dhall-lang/dhall-lang/issues/446
2019-03-28 08:51:01 -07:00
Gabriel Gonzalez
2a78ac06b7
Define expression equality as CBOR equality (#866)
... as standardized in https://github.com/dhall-lang/dhall-lang/pull/426

This adds two new `ToTerm`/`FromTerm` classes in order to minimize
code disruption.  The main disruption is due to renaming the old
`encode`/`decode` to `encodeExpression`/`decodeExpression`
2019-03-27 18:26:02 -07:00
Gabriel Gonzalez
a2ab6a59ec
Add support for empty alternatives (#863)
... as standardized in https://github.com/dhall-lang/dhall-lang/pull/438

This also adds `dhall-json` support for empty alternatives

In particular, this translates empty alternatives to strings encoding the alternative name

```haskell
-- ./example.dhall

let Role = < Wizard | Fighter | Rogue >

in  [ Role.Wizard, Role.Fighter ]
```

```
$ dhall-to-json <<< './example.dhall'
["Wizard","Fighter"]
```
2019-03-27 15:29:10 -07:00
Gabriel Gonzalez
bf067eeb69
Build against QuickCheck-2.13 (#867)
Related to https://github.com/commercialhaskell/stackage/issues/4444
2019-03-26 09:52:19 -07:00
PanAeon
e6be5c050e
LSP. Fix import errors location. Minor clean-up. Add tests for backend/diagnostics. (#868) 2019-03-26 13:20:25 +00:00
Gabriel Gonzalez
4c9dc60b20
Fix dhall decode bug (#859)
... as caught by @singpolyma

`Dhall.Binary.unApply` was failing to uncurry functions due to the presence of
`Note` constructors.  This caused `dhall encode` to produce different
results from `dhall hash` since the latter was normalizing the expression
(and therefore removing `Note` constructors) whereas the former was not.
2019-03-24 13:18:21 -07:00
Gabriel Gonzalez
c900081a34
Remove deprecated Path constructor (#858)
The `Path` constructor was deprecated a long time ago, so it's pretty
safe to remove now
2019-03-24 12:21:08 -07:00
Gabriel Gonzalez
ff3dc7f9e7
Add --help information for --annotate flag (#856) 2019-03-24 11:42:27 -07:00
Gabriel Gonzalez
c3ba33a80a
Add unit tests (#854)
... as standardized in https://github.com/dhall-lang/dhall-lang/pull/416
2019-03-24 11:01:43 -07:00
Gabriel Gonzalez
dce46fc6c8
Add --alpha flag to α-normalize output (#855)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/853

... as suggested by @singpolyma
2019-03-16 11:20:19 -07:00
Justin Le
35513e715a Fix for UnionType (#857)
Fix the type equality check by using judgmental equality
2019-03-16 10:12:55 -07:00
Gabriel Gonzalez
d8f2787745
Link to Discourse site from dhall-lang.org (#852) 2019-03-14 08:48:23 -07:00
Gabriel Gonzalez
bffe2ed2a1
Remove support for URL fragments (#851)
... as standardized in https://github.com/dhall-lang/dhall-lang/pull/406
2019-03-14 07:23:23 -07:00
Gabriel Gonzalez
4b7bdd458c
Add CORS support (#846)
... as standardized in https://github.com/dhall-lang/dhall-lang/pull/411
2019-03-12 18:36:38 -07:00
Gabriel Gonzalez
b31ec4db5c
Narrow the imports used by the test suite (#850)
As standardized in https://github.com/dhall-lang/dhall-lang/pull/420
2019-03-11 20:47:09 -07:00
Gabriel Gonzalez
f703d271b6
Add Nix support for dhall-lsp-server project (#849) 2019-03-10 09:43:44 -07:00
PanAeon
21f9e951cc
[LSP] add basic formatting (#844) 2019-03-08 14:24:54 +00:00
Gabriel Gonzalez
1e3c2a1c84
Be more strict when decoding variables named "_" (#847)
... as standardized in https://github.com/dhall-lang/dhall-lang/pull/407
2019-03-07 22:09:41 -08:00
Gabriel Gonzalez
2efed4b4a5
Expand the set of valid quoted labels (#840)
... as standardized in https://github.com/dhall-lang/dhall-lang/pull/408
2019-03-07 21:42:57 -08:00
Gabriel Gonzalez
33c695fd55
Fix versions of dhall-bash/dhall-text (#845)
I forgot to bump these versions when cutting the latest release
2019-03-07 21:12:03 -08:00
Gabriel Gonzalez
e92a749904
Change language around security guarantee (#841)
Related to https://github.com/dhall-lang/dhall-lang/issues/333

This softens the language to point out that we can't guarantee
that we are secure against malicious expression but we do aim to be
and we don't settle for less.
2019-03-07 20:43:37 -08:00
PanAeon
f2f4fc2979 Add dhall-lsp-server (#843) 2019-03-06 21:41:38 -08:00
Gabriel Gonzalez
e392657540
Version 1.20.1 → 1.21.0 (#839) 2019-03-06 20:49:41 -08:00
Gabriel Gonzalez
f6d6ccd0c5
Add new --omitEmpty option (#842)
... as proposed in https://github.com/dhall-lang/dhall-kubernetes/issues/46#issuecomment-468530601

`--omitEmpty` is the same as `--omitNull` except it also omits fields that
are empty records.  To be precise, it omits fields whose transitive fields
are all `null` (and an empty record is a special case of a record whose
transitive fields are all `null` since it is vacuously true when there are
no fields).

This allows Dhall configurations that target YAML to avoid having to nest
sub-records inside of an `Optional` value.  Omitting unnecessary `Optional`
layers reduces the number of default values that the configuration format
needs to thread around.
2019-03-06 14:52:40 -08:00
Gabriel Gonzalez
aa359813c4
Install mostly static executables on OS X when using Nix (#830)
These aren't fully static executables (they still have some
`/nix/store` references), but they at least compile Haskell dependencies
statically.  That means that they can be `nix-env --install`ed side-by-side
with other Haskell executables, which would otherwise conflict with an
error like this one:

```
error: packages '/nix/store/hrxnlwlsiw5jjjkq5v6ihcwb0shx4fga-dhall-1.20.1/lib/li
nks/libHSbasement-0.0.8-8QjArDsw3GWCcbHE5iqtz3-ghc8.4.3.dylib' and '/nix/store/d
2y5373anwf1q3h86ar3lljk11k1lq0h-dhall-json-1.2.6/lib/links/libHSbasement-0.0.8-8
QjArDsw3GWCcbHE5iqtz3-ghc8.4.3.dylib' have the same priority 5; use 'nix-env --s
et-flag priority NUMBER INSTALLED_PKGNAME' to change the priority of one of the
conflicting packages (0 being the highest priority)
```
2019-03-04 19:43:31 -08:00
Gabriel Gonzalez
05d9405d29
Simplify import resolution logic (#833)
... as standardized in https://github.com/dhall-lang/dhall-lang/pull/391

This also updates the `loadWith` judgment to more closely match the variable
names used in the standard
2019-03-04 19:11:25 -08:00
Fabrizio Ferrai
b7af16a869 Use binary encoding in parser tests (#836) 2019-03-03 15:28:55 -08:00
Fabrizio Ferrai
74e8003905
Sort record and union fields when CBOR-encoding (#835)
Also sort fields in the `Arbitrary` instance for `Dhall.Map` in serialization tests
2019-03-04 00:08:43 +02:00
Basile Henry
13a1158538 Fix REPL autocomplete (#837)
This commit fixes an issue that made the last branch of the completer
unreachable.

The second to last branch was always `True`:

```
> split (== '.') "anything"
["anything"]
```

Signed-off-by: Basile Henry <bjm.henry@gmail.com>
2019-03-02 14:54:18 -08:00