aff138e192
* Handle empty alternatives when converting from JSON Fixes https://github.com/dhall-lang/dhall-haskell/issues/1074 `dhall-to-{json,yaml}` treat empty alternatives as strings of the same name, but `{json,yaml}-to-dhall` were missing the corresponding logic to decode strings to empty alternatives, which this change fixes. This also ensures that the conversion logic contains no more `undefined`s, by making the union conversion branch total. * Clarify successful cases for union handling Co-Authored-By: Simon Jakobi <simon.jakobi@gmail.com> * Add missing trailing newline ... as caught by @sjakobi |
||
---|---|---|
.. | ||
dhall-to-json | ||
dhall-to-yaml | ||
examples | ||
java | ||
json-to-dhall | ||
src/Dhall | ||
tasty | ||
yaml-to-dhall | ||
.gitignore | ||
CHANGELOG.md | ||
LICENSE | ||
README.md | ||
Setup.hs | ||
default.nix | ||
dhall-json.cabal | ||
release.nix | ||
shell.nix |
README.md
dhall-json
For installation or development instructions, see:
Full documentation here:
Introduction
This dhall-json
package provides a Dhall to JSON compiler and a Dhall to YAML
compiler. The reason this package is called dhall-json
is that the Haskell
yaml
library uses the same data structure as Haskell's aeson
library for
JSON
Example
$ dhall-to-json <<< "{ foo = 1, bar = True }"
{"foo":1,"bar":true}
$ dhall-to-json <<< "List/head Natural ([] : List Natural)"
null
$ dhall-to-yaml <<< "{ foo = [1, 2, 3], bar = { baz = True } }"
foo:
- 1
- 2
- 3
bar:
baz: true