Commit Graph

856 Commits

Author SHA1 Message Date
Gabriel Gonzalez
2d2c897e3f
Include standard version in dhall version output (#793)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/791
2019-01-25 09:01:55 -08:00
Mario Lang
0460f28a38 Fix a typo (#792) 2019-01-23 14:57:06 -08:00
Javier Neira
a2a7985f5e Use appveyor to build, test and deploy in windows (#785) 2019-01-22 08:15:29 -08:00
Gabriel Gonzalez
095ee6db61
Don't fail if $HOME environment variable is unset (#789)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/788

This removes the dependency on the `directory` library's utility
functions (which require `HOME` to be set)
2019-01-21 08:22:16 -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
8f3e913cde
Use git submodule to obtain official Prelude and test suite (#787)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/766
2019-01-19 09:09:34 -08:00
Gabriel Gonzalez
96d34ee92a
Don't disable -fwarn-incomplete-uni-patterns at module level (#784)
... as suggested by @ocharles in
c368d66a6f (commitcomment-31973007)

Instead, explicitly opt out more narrowly with `unsafeExpect*` functions
2019-01-18 07:13:49 -08:00
Gabriel Gonzalez
f24f665047
Fix non-exhaustive pattern match in dhall lint (#780)
`dhall lint` would fail on the following expression:

```
    let replicate = https://prelude.dhall-lang.org/List/replicate

in  let Config = { name : Text, age : Natural }

in  let Configs = List Config

in  replicate 10 Text "!"
```

... because the code (incorrectly) assumed that simplifying an inner
`let` binding would preserve at least one `let` binding.  However, when the
outer `let` (beginning with `let replicate`) is simplified the inner `let`
(beginning with `let Config`) simplifies down to just `replicate 10 Text "!"`
which has no `let` binding at all, leading to a pattern match failure.

This change fixes that by extending the code to correctly handle that case
with an exhaustive pattern match.
2019-01-16 21:59:11 -08:00
Gabriel Gonzalez
aed91b3b44
Fix parsing of list annotations (#779)
Related to: https://github.com/dhall-lang/dhall-lang/issues/343

According to the standard a non-empty list with a type annotation should
not be encoded with the type annotation alongside the list elements.  The
type annotation should be parsed and encoded as a separate constructor.
2019-01-16 20:28:12 -08:00
Gabriel Gonzalez
3a315225d7
Build against http-client-0.6 (#776)
Related to https://github.com/commercialhaskell/stackage/issues/4290
2019-01-16 20:09:37 -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
Javier Neira
3f004ff9bb Fix test errors in windows caused by encoding (#782) 2019-01-16 19:15:57 -08:00
Justin Le
ec48c20f04 UnionType and UnionInputType, analogues of RecordType and RecordInputType (#775) 2019-01-15 16:55:56 -08:00
Javier Neira
d481f47bed Add eta support and update stack config to lts-13 (#778) 2019-01-11 19:35:39 -08:00
Gabriel Gonzalez
162dde95ac
Add inputNormalizer field to InterpretOptions (#777)
This fixes the problem found in https://github.com/dhall-lang/dhall-lang/issues/166#issuecomment-452766374

This ensures that the functions marshalled into Haskell can correctly take
advantage of user-supplied language extensions
2019-01-11 08:29:40 -08:00
Gabriel Gonzalez
fc3472d085
Version 1.20.0 → 1.20.1 (#773) 2019-01-05 18:51:33 -08:00
Nicholas Scheel
78ca289335 Update standard version to 5.0.0 in Binary.hs (#771) 2018-12-31 10:48:17 -06:00
Gabriel Gonzalez
6a70f133a1
Version 1.19.1 → 1.20.0 (#767) 2018-12-29 11:48:21 -06:00
Basile Henry
528ea42407 Fix error message for not-equal when type checking (#768)
According to the standard https://github.com/dhall-lang/dhall-lang/blob/master/standard/dhall.abnf\#L399 the correct operator is `!=`
2018-12-28 13:47:11 -06:00
Gabriel Gonzalez
0b3fd4b624
Prenormalize substituted expressions (#765)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/764

This pre-normalizes expressions before substituting them to
avoid duplicated work.  This also fixes the space leak from the
above issue.
2018-12-24 09:35:56 -06:00
Gabriel Gonzalez
ca78d7977d
Fix type-checking bug for unions (#763)
The Haskell implementation was not matching the specification for
type-checking union types:

* The inferred type of union types was (incorrectly) always returning `Type`
* Unions of mixed alternative types were not being properly rejected

I also discovered several mistakes in the error messages, which I fixed along
the way.
2018-12-22 08:39:26 -06:00
Gabriel Gonzalez
f8e31956e9
Fix first example on dhall-lang.org (#762)
Several people commented that they had difficulty with the first example:

* They didn't realize that the mistake was supposed to be typo because they
  never found it
* They didn't realize they were supposed to progress to the next tab

This changes fixes those two issues
2018-12-21 08:52:42 -06: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
Adam Sandberg Eriksson
026db247f7 Fix haddock syntax (#761) 2018-12-19 07:19:07 -08:00
Gabriel Gonzalez
374f42ad98
Fix live editor for dhall-lang.org (#759)
Setting the `display: none` style for `textarea`s makes them uneditable
2018-12-17 18:10:41 -08:00
Gabriel Gonzalez
34e1d79eaa
Additional fixes to dhall-lang.org (#758)
This updates `dhall-lang.org` with the following main changes:

* Greater emphasis on Dhall as a YAML alternative
    * New tagline: "A non-repetitive alternative to YAML"
    * YAML output now selected by default
* More prounounced call to action (i.e. "Get Started" button)
    * Now located in both navbar and in final section
* Fixed issues identified by Chrome's audit tool
    * Better SEO
    * Textual header
    * Alternative text for images
    * Slight improvements to Javascript loading
* Better support for mobile browsers
    * The input/output code panes will now vertically stack
2018-12-17 09:43:07 -08:00
Gabriel Gonzalez
21d70b3383
Restrict try-dhall build to Linux (#756) 2018-12-14 18:50:21 -08:00
Basile Henry
145d150e25 Fix link (#755) 2018-12-13 07:07:05 -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
ed30a6a394
Fix link to built-in operators on website (#751) 2018-12-11 05:19:03 -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
Fintan Halpenny
a95acd5b2a Add Unordered Map Traversal (#749) 2018-12-10 10:46:46 -08:00
Basile Henry
cdef63b28e try-dhall: Remove .pub from example private key (#748) 2018-12-10 08:28:08 -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
db6f80fec2
Add --compact flag to dhall-to-json (#743)
This is phase 1 of transitioning to pretty-printing by default, as
described here:

https://github.com/dhall-lang/dhall-haskell/issues/716#issuecomment-445485153

This flag allows users who prefer the compact format a smooth migration
path
2018-12-09 08:17:33 -08:00
Gabriel Gonzalez
cfe62c99e9
Fix dhall-to-bash translation of Optional literals (#736)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/735
2018-12-08 13:11:35 -08:00
Gabriel Gonzalez
2a30c7f4fc
Update binary encoding/decoding for imports (#728)
... as standardized in https://github.com/dhall-lang/dhall-lang/pull/308

This adds support for encoding/decoding custom headers and integrity checks.
2018-12-08 10:25:07 -08:00
Gabriel Gonzalez
6ab5df4d49
Implement standardized support for multi-line literals (#726)
... as standardized in https://github.com/dhall-lang/dhall-lang/pull/307

Note that this a breaking change because:

* Newlines are now mandatory after the opening `''` of a multi-line
  literal
* The spaces before the trailing `''` count towards the leading
  indentation computation
2018-12-08 08:49:08 -08:00
Georges Dubus
f308ca29b0 Fix diff so that an empty list is equal to itself (#740)
* Test with QuickCheck that an expression is always the same as itself

I noticed cases where the diffing code returns that an expression is not the
same as itself (for example, an empty list). This commit adds a QuickCheck test
to illustrate it, and maybe other cases.

Sadly, I had to expose some internals from Dhall.Diff for the test, which makes
the interface less nice.

* Fix diff so that an empty list is the same as itself
2018-12-07 09:07:47 -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
aiya000
bce7230c3e Fix README.md's dhall badge (#738)
:D
2018-12-05 08:25:54 -08:00
Gabriel Gonzalez
83c4a32e99
Refactor test suite (#733)
This moves all of the test suite modules underneath a `Dhall.Test`
module hierarchy instead of clobbering the top-level namespace.
2018-12-03 09:17:53 -08:00
Gabriel Gonzalez
9148b35aba
Build against tasty-1.2 (#731)
Related to https://github.com/commercialhaskell/stackage/issues/4196
2018-12-03 08:48:43 -08:00
Gabriel Gonzalez
7dd6b76d04
Update READMEs (#732)
This updates all of the `README`s to:

* centralize all of the build/install/develop information in the
  top-level `README`
* get the nested `README`s to use a consistent style
2018-12-03 08:30:30 -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