Commit Graph

83 Commits

Author SHA1 Message Date
34238f66da Flake: take dhall-lang as input 2019-12-22 09:04:03 +00:00
Simon Jakobi
85645a2470 dhall-to-{json,yaml,yaml-ng}: Handle empty maps correctly (#1561)
Fixes #1559.

This requires aeson-yaml >= 1.0.5.0 since older versions
incorrectly encode empty objects.

The raised bound also fixes #1560. A regression test is included.
2019-12-01 18:41:46 +00:00
Simon Jakobi
feb378b8da Add an internal "dhall haskell-syntax-tree" command (#1553)
… for debugging.
2019-11-22 03:57:14 +00:00
Simon Jakobi
3b222cda91 Write cache files atomically (#1544)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/1540.
2019-11-22 00:49:46 +00:00
Simon Jakobi
dedd5e0ea6
Strip trailing whitespace (#1422)
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>
2019-11-14 14:43:35 +01:00
Gabriel Gonzalez
39aaa86fb9
Revamp dhall-lang.org (#1526)
The main changes are:

* Rework the text substantially to match [the new
  "pitch"](https://discourse.dhall-lang.org/t/more-brainstorming-for-changing-the-dhall-lang-org-landing-page/101/18)
* Add a new "Hash" tab to the live demo
* Use the [new logo](https://github.com/dhall-lang/dhall-lang/pull/803)
2019-11-13 08:34:44 -08:00
Simon Jakobi
cd49b65c23 Move HsYAML-based code to new package dhall-yaml (#1514)
* Shared code for the dhall-to-yaml[-ng] executables stays in dhall-json.
* Shared tests are in dhall-yaml.

Fixes #1435.
2019-11-07 12:11:04 +00:00
David Francoeur
1b46f1885f Attempt at fixing missing root certificate, #1491 (#1493)
* Attempt at fixing missing root certificate, #1491

https://github.com/dhall-lang/dhall-haskell/issues/1491

* Remove extra comma in shared.nix

Co-Authored-By: Simon Jakobi <simon.jakobi@gmail.com>

* Update nix/shared.nix

Co-Authored-By: Gabriel Gonzalez <Gabriel439@gmail.com>
2019-11-02 03:25:57 +00:00
Simon Jakobi
458c873706 Website: List XML integration via dhall-xml-ruby (#1481) 2019-10-27 01:55:01 +00:00
Sergei Dolgov
ad443cd685 Fix dhall-lsp-server to be "-Wall clean" (#1446) (#1449) 2019-10-21 12:54:00 +00:00
48ca2d2424 Optionally pass Nixpkgs through entry functions (#1409)
The "builtins.fetchTarball" function is not available in some restricted
environments such as build jobs of the latest Hydra. Make it possible to
pass nixpkgs and nixpkgsStaticLinux when evaulating default.nix and
release.nix to avoid importing them internally. This does not change the
result of evaulation if no parameters are passed.
2019-10-17 19:06:21 -07:00
Gabriel Gonzalez
03ca91baca
Fix CI to properly reject incomplete haddocks (#1418)
My first attempt to do this in #1416 did not correctly reject incomplete
haddocks, which this change fixes
2019-10-16 19:49:44 -07:00
Patrick Mylund Nielsen
96e694d7c6
'gpl' cabal flag to switch between HsYAML and aeson-yaml (#1417) 2019-10-15 03:12:12 -04: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
mujx
645b71d6b3 Functional tests setup for the LSP server (#1396)
* Functional tests setup for the LSP server

* Add nix derivation for lsp-test-0.6.1.0

* Register fixture files

* Enable functional tests on appveyor

* Attempt to fix Position errors

* Fix `dhall-lsp-server` to specify a UTF8 locale

Related to https://github.com/dhall-lang/dhall-haskell/issues/1356#issuecomment-536840612

* Specify utf8 encoding for tests

* Add test for hovering functionality

* Add glob to list fixture files

* Remove extra do
2019-10-10 02:27:15 +00:00
Vijay Tadikamalla
cced515494 Migrate to the HsYAML package (#1248) 2019-10-05 14:52:19 -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
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
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
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
Frederik Ramcke
523861a92c dhall-lsp-server: Upgrade to haskell-lsp 0.15 (#1203)
* Clean up dhall-lsp-server.cabal

Removes unused dependencies.

* Upgrade to haskell-lsp-0.15.0.0

The stackage LTS version is still 0.8.2 so we need to add this as an
'extra-dep'.

* Display type information as plaintext rather than markdown

* Fix nix build

* Update nix haskell-lsp-types
2019-08-07 11:40:43 +00:00
Simon Jakobi
42d80b057d
Include dhall-nix in stack and cabal project configs (#1178)
Note that `dhall-nix` cannot be built on Windows due to its transitive
dependency on the `unix` package.

Also:

* Nix: Enable `-Werror` for `dhall-nix`

* Add support for `toMap` in `dhall-nix`:

    \(x : { a : Bool }) -> toMap x

is translated as

    x:
      (kvs:
        map (k:
          {
            mapKey = k;
            mapValue = builtins.getAttr k kvs;
            }) (builtins.attrNames kvs)) x
2019-07-31 18:24:15 +02: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
Gabriel Gonzalez
90b62ee9d7 Replace dhall-to-text with dhall text subcommand (#1090)
Fixes #1087
2019-07-08 17:18:09 +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
Gabriel Gonzalez
d77a9f4e43
Restore dhall-nix to build against Hackage (#1000)
Now that `hnix-0.6.1` is out `dhall-nix` can be built against recent
versions of Hackage packages and will be uploaded as part of the
next release
2019-06-10 08:29:05 -07:00
Gabriel Gonzalez
6748d15584
Fix dhall-json test failure (#997)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/996

This enables the test suite for `dhall-json` and also ensures that
all packages are built using the source distribution (to catch
missing `extra-files`)
2019-06-09 08:17:07 -07:00
Gabriel Gonzalez
89817b41fd
Build docker images for each package in CI (#950)
Fixes #513
2019-05-13 10:37:03 -07: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
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
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
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
Gabriel Gonzalez
f4542d5bc5
Integrate dhall-nix into CI (#887) 2019-04-11 09:16:43 -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
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
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
f703d271b6
Add Nix support for dhall-lsp-server project (#849) 2019-03-10 09:43:44 -07: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
68c5278559
Support GHC 7.10.3 for all Dhall packages (#814)
This also updates the declared set of GHC versions tested with in the
`.cabal` files
2019-02-11 22:45:34 -08:00
Gabriel Gonzalez
bebfbf2a5a
Change default.nix to use static linking when possible (#786)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/783

... as suggested by @PierreR in https://github.com/dhall-lang/dhall-haskell/issues/783#issuecomment-455502506
2019-01-19 09:36:47 -08:00
Gabriel Gonzalez
f5928e4472
Fix Nix build to reinstate -Werror (#781)
A refactor of the Nix build accidentally removed the `-Werror` flag, which
caused some warnings to get past CI.  This change fixes that and removes the
warnings.
2019-01-16 19:39:51 -08:00
Gabriel Gonzalez
2635c582eb
Add contributing instructions for the website (#760)
This is so that I can link people to the `README` if they are interested in
improving the site
2018-12-20 10:36:10 -08:00
Gabriel Gonzalez
21d70b3383
Restrict try-dhall build to Linux (#756) 2018-12-14 18:50:21 -08:00
Gabriel Gonzalez
615eccb10d
Expand main page with high-level reasons to adopt Dhall (#754)
This adds four new sections to the page after the live demo which highlight
the common themes that I notice people use when communicating the value of
Dhall to others on social media:

* The first section emphasizes the element of delight in using the language for
  people who are into elegance and quality

* The second section focuses on more pragmatic people who are sick of YAML and
  just want a reasonable alternative that they can convince their manager to
  adopt

* The third section appeals to the LangSec crowd that wants an uncompromising
  and secure foundation for what they are buliding

* The last section targeted at the skeptic who thinks that Dhall is an ivory
  tower language not suited for real-world problems.

The second crowd (YAML emigrants) is the audience that I'm targeting the
most strongly at the moment, but I didn't want to lead with a negative reason
adopt by focusing on the limitations of YAML, so I put the section on delight
first so that we could start with a more positive tone.
2018-12-13 06:44:33 -08:00
Gabriel Gonzalez
dfd9822e77
Add new "Type" and "YAML" output tabs to live demo (#753)
This moves the type annotation into a separate tab, both to avoid
the type cluttering the default output tab and to allow a display
mode that focuses on highlighting just the type.

This also adds a "YAML" output tab to gently suggest to the user
that Dhall is intended to be an alternative to YAML.  Unfortunately,
we can't use the Haskell `yaml` package to render to YAML when
building with GHCJS, but we can still perform the JSON-to-YAML
conversion in JavaScript.
2018-12-12 16:53:24 -08:00
Gabriel Gonzalez
82165d525d
Remove the try-dhall-server build product (#752)
This build product is no longer necessary now that the live demo can import
things from the Prelude
2018-12-11 05:20:54 -08:00
Gabriel Gonzalez
00315c1449
Fix kubernetes logo in list of integrations (#750)
The logo is an SVG file, not a PNG
2018-12-11 05:17:07 -08:00
Gabriel Gonzalez
d7d8139d39
Expand "Try dhall" into dhall-lang.org home page (#747)
This expands the "Try dhall" page to serve as a functional home page for
"dhall-lang.org" in the short term by making the following changes:

* Adding a navigation bar to the top that links to useful resources and
  official integrations
* Adding a quick summary explaining what Dhall is
2018-12-10 12:28:19 -08:00