Commit Graph

12 Commits

Author SHA1 Message Date
mujx
045ed99ae5 Add the --preserveNull flag and omit null fields by default on dhall-to-yaml (#1365)
* Add the `--preserveNull` flag and omit null fields by default on `dhall-to-yaml`

fixes #1354

* Restore the `--omitNull` flag and apply `--preserveNull` to `dhall-to-json`

* Adjust examples that return null fields

* Mention the default behaviour regarding nulls

* Null -> null
2019-10-04 02:21:47 +00:00
Dima
cc71c65c17 Enable --pretty by default for dhall-to-json (#1373)
* Enable --pretty by default for dhall-to-json

* add Deprecation notice into dhall-to-json help

* update dhall-to-json output examples in src/Dhall/JSON.hs
2019-10-03 02:08:39 +00:00
Simon Jakobi
23910e70e3 dhall-json: Add --output options (#1304)
As requested in #1303.
2019-09-11 06:05:19 +00:00
Gabriel Gonzalez
d66d1db33f Fix --version flag handling for dhall-json package (#1199)
* Fix `--version` flag handling for `dhall-json` package

Fixes https://github.com/dhall-lang/dhall-haskell/issues/1198

This changes version to be a separate constructor for options parsing,
in order to make invalid states unrepresentable and to fix issues like
the above one.

* Undo `allowImports` changed

This was a change I forgot to stash while working on the fix for the
`--version` flag

* Fix missing `Paths_dhall_json` in `dhall-json.cabal`
2019-08-06 06:28:46 +00:00
Simon Jakobi
1700fa72d8 Fix import logic with --file for dhall-to-{json,yaml} (#1191)
Fixes #1183.
2019-08-03 11:03:42 +00:00
Gabriel Gonzalez
1a27cad137 Add --file option to dhall-json executables (#1107)
* Add `--file` option to `dhall-json` executables

Fixes https://github.com/dhall-lang/dhall-haskell/issues/1096

* s/JSON/expression/

... as caught by @sjakobi

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

* s/expression/YAML expression/

... as caught by @sjakobi

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

* Change the program descriptions for `{json,yaml}-to-dhall`

... as suggested by @sjakobi
2019-07-18 19:08:47 +00:00
Gabriel Gonzalez
8139c3678c
Change YAML/JSON encoding for NaN/Infinity/-Infinity (#946)
Before, `dhall-to-json`/`dhall-to-yaml` would use approximate
representations for special `Double` values.  Specifically, `NaN`
would encode as `null` and `±Infinity` would encode as the minimum
and maximum `Double` values.

After this change, YAML will now use `nan`/`inf`/`-inf` to encode
these values (since special `Double` values are natively supported
by YAML) and the JSON encoding will reject them by default.  The
user can restore the old behavior for the JSON encoding by enabling
the `--approximate-special-doubles` flag.
2019-05-12 16:04:25 -07:00
Gabriel Gonzalez
f6d6ccd0c5
Add new --omitEmpty option (#842)
... as proposed in https://github.com/dhall-lang/dhall-kubernetes/issues/46#issuecomment-468530601

`--omitEmpty` is the same as `--omitNull` except it also omits fields that
are empty records.  To be precise, it omits fields whose transitive fields
are all `null` (and an empty record is a special case of a record whose
transitive fields are all `null` since it is vacuously true when there are
no fields).

This allows Dhall configurations that target YAML to avoid having to nest
sub-records inside of an `Optional` value.  Omitting unnecessary `Optional`
layers reduces the number of default values that the configuration format
needs to thread around.
2019-03-06 14:52:40 -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
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
Justin Woo
f3d26e5f32 add --version to dhall-json (#704) 2018-11-24 08:35:58 -08: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