`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.
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.
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.
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.
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
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
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.
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.
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
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
... 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
* 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
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.
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
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