Commit Graph

42 Commits

Author SHA1 Message Date
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
Ehmry - 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
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
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 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 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
Gabriel Gonzalez 67ebf6efd6
Minify Javascript code generated by GHCJS (#745)
This reduces the size of the generated JavaScript code from ~15 MB to ~6 MB
2018-12-10 07:21:41 -08:00
Gabriel Gonzalez c1e1ab1a13
Add an example of using imports (#746)
We can import expressions from `https://prelude.dhall-lang.org`
now that it provides CORS support.  See:

https://github.com/dhall-lang/dhall-lang/pull/315
2018-12-10 06:55:28 -08:00
Gabriel Gonzalez e75469983d
Add "Try Dhall" examples and JSON output (#742)
This change sthe layout to a side-by-side split-pane output
and also adds tabs for each pane:

* Tabs for the left pane let you switch between examples
* Tabs for the right pane let you switch between output modes
2018-12-09 08:24:33 -08:00
Gabriel Gonzalez cf69f5a953
Add "Try Dhall" project (#739)
This adds three new Nix build products:

* `try-dhall-static` - The static assets for "Try Dhall"
* `try-dhall-server` - A script which serves the static assets for local
   debugging
* `tarball-try-dhall` - A tarball of the static assets

This is powered by a new small `dhall-try` package which is also included
in this change.
2018-12-06 18:00:03 -08:00
Gabriel Gonzalez 10a781534d
GHCJS support for Dhall (#734)
This adds a GHCJS build for Dhall so that:

* We can build a `try.dhall-lang.org` to try Dhall in the
  browser until the PureScript implementation comes online
* We can document how to build `dhall` using GHCJS
* We can verify that new changes to `dhall` or its dependencies
  don't break GHCJS support
* CI can build and cache GHCJS-related dependencies
2018-12-03 08:07:18 -08:00
Gabriel Gonzalez ec2d6c866c
Add `mass` utility function to `./nix/shared.nix` (#730)
This simplifies mass disabling of tests or jailbreaking of packages,
typically in order to test builds against latest versions of
dependencies for Stackage.
2018-12-02 20:26:27 -08:00
Gabriel Gonzalez dc5493d87f
Test build against `ghc-8.6` (#669)
This ensures that all of the `dhall-*` libraries build against
GHC 8.6.1, but still generates tarballs using GHC 8.4.3 and
uses GHC 8.4.3 for development
2018-11-03 07:27:12 -07: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