Commit Graph

11 Commits

Author SHA1 Message Date
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 e931451a2b Format more text literals as multi-line strings (#1508)
This causes text literals to be formatted as multi-line strings
whenever they contain at least one newline and at least one non-newline
character. "Spacers" like `"\n\n"` continue be formatted as single-line
strings. If the heuristic turns out to be too eager to choose a
multi-line layout, we can refine it later.

This partially addresses #1496.

Also

* update some variable names

* use 80-column "smart" layout consistently
2019-11-04 03:31:49 +00:00
Gabriel Gonzalez 17fb0e3c46
100% haddock coverage (#1416)
This updates the `dhall` package to have 100% haddock coverage and
also updates CI to enforce this going forward.

This also includes a change to deprecate the `X` type synonym, which
I noticed along the way
2019-10-13 22:22:39 -07:00
Simon Jakobi e061f35c4c Simplify Dhall.Parser.Combinators.toMap (#1053)
This changes the parsing error for some cases.

Previously:

    ⊢ {b=1, a=1, b=1, a=1}

    Error: Invalid input

    (stdin):1:20:
      |
    1 | {b=1, a=1, b=1, a=1}
      |                    ^
    duplicate field: b

Now:

    ⊢ {b=1, a=1, b=1, a=1}

    Error: Invalid input

    (stdin):1:20:
      |
    1 | {b=1, a=1, b=1, a=1}
      |                    ^
    duplicate field: a

Also add a new function to Dhall.Map: fromListWithKey
2019-07-03 15:46:13 +00: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
quasicomputational d77e174ab7 CPP out Monad.fail definition. (#961)
As Dhall's bounds don't allow base 4.13, this doesn't actually affect
anyone running in a supported configuration (i.e., without
--allow-newer). Further note that base 4.13 (i.e., GHC 8.8) isn't
tested in CI at present.

This could well be the last GHC 8.8-related change needed to
code (bounds will definitely need to be adjusted). In this case, a
Dhall release with relaxed bounds will suffice to finish off GHC 8.8
support.

However, it's also possible that dependencies might bundle together
breaking changes with 8.8 support, in which case adaptations will
still need to be made.
2019-05-22 18:48:31 -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 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 98497e44ec
Add source position information for missing imports (#812)
Related to #561

This adds source position information to missing imports

Before:

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

↳ ./foo

Error: Missing file …/foo
```

After:

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

↳ ./foo

Error: Missing file …/foo

(stdin):1:1
```
2019-02-08 07:32:00 -08:00
Dan Burton 7aba79118c Use an Ordered Set for Project (#670) 2018-11-05 19:59:01 -08:00
Gabriel Gonzalez aecfbc9acc
Migrate `dhall-{bash,json,text}` into this repository (#661)
The motivation for this change is:

* To catch build failures in downstream packages whenever we make a breaking
  change to the `dhall` API
* To reduce the amount of work I need in order to cut a release for all of
  these packages
* To better share Nix/CI-related logic between the projects

Note that I have not yet migrated `dhall-nix` in.  I'm waiting for
https://github.com/dhall-lang/dhall-nix/issues/17 to be fixed since
`dhall-nix` is incompatible with later versions of `megaparsec` due to
`hnix`.
2018-10-28 17:32:51 -07:00