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>
* 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
* 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`
* [#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>
* [#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>
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)
* 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
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.
* 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!
* 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`
* [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
* 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
…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.
* 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