Commit Graph

16 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
Gabriel Gonzalez 8e7586b247
Fix `dhall-to-yaml` to quote special strings (#1474)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/1472

This also refactors the code to a form that was easier for me to understand
2019-10-25 08:29:32 -07:00
Akshay Mankar 194654c10c Optionally allow missing lists in yaml/json-to-dhall (#1414)
[#1410]
2019-10-11 21:43:05 +00:00
Gabriel Gonzalez eee75242a4 Fix `{json,yaml}-to-dhall` marshaling into empty lists (#1284)
This is essentially the same fix as #1186, applied in more places
2019-09-06 23:00:00 +00:00
Gabriel Gonzalez 268c79631d Fix `yaml-to-dhall` support for empty objects (#1186)
* Fix `yaml-to-dhall` support for empty objects

`yaml-to-dhall` was decoding an empty object into:

```dhall
[] : { mapKey : Text, mapValue : Text }
```

... instead of:

```dhall
[] : List { mapKey : Text, mapValue : Text }
```

... which this change fixes

* Add missing test files

* Hopefully fix test failure on Windows

I suspect that the test failure is due to the locale for the test suite
not being set to UTF8
2019-08-09 18:21:40 +00:00
Simon Jakobi 1d58840feb
dhall-json: Nesting: Support empty alternatives as contents (#1204)
Closes #1201.
2019-08-06 13:24:18 +02: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
Simon Jakobi 7dc7856d10 dhall-json: Allow empty alternative for Nesting.Inline (#1122)
Fixes #1092.
2019-07-19 16:19:19 +00:00
Gabriel Gonzalez 81ef514652 Move more `dhall-json` test logic into data files (#1108)
* Move more `dhall-json` test logic into data files

... as suggested @sjakobi in https://github.com/dhall-lang/dhall-haskell/pull/1094#pullrequestreview-261053408

* Fix CI failure

... as caught by @sjakobi

* Fix missing import of `(<>)`

... as noted by @sjakobi
2019-07-15 17:08:38 +00:00
Gabriel Gonzalez e49710166e
Add `dhall-json` support for unions as keys (#1094)
This is inspired by this StackOverflow question:

https://stackoverflow.com/questions/56967374/dynamic-records-key-type
2019-07-12 22:25:46 -07:00
Gabriel Gonzalez aff138e192 Handle empty alternatives when converting from JSON (#1083)
* 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
2019-07-08 03:09:24 +00:00
Gabriel Gonzalez b8e19d614a Fix `dhall-json`'s support for preserving alternative names (#1080)
* Fix `dhall-json`'s support for preserving alternative names

... as caught by @sjakobi in the course of #1077

The code has to be updated to reflect the new normal forms for
union literals

* Add tests

... as suggested by @sjakobi
2019-07-07 10:27:54 +00:00
Javier Neira 56264270e4 Another step in isolate yaml and prepare for HsYaml replacement (#993) 2019-06-07 20:26:05 -07:00
Javier Neira 1d3f3d32fe [dhall-json] Isolate yaml usage behind `Dhall.Yaml` (#989) 2019-06-05 08:01:55 -07:00
Dmitry Dolgov 07906673af [POC] Add 'quoted' option (#941)
Allow to generare quoted scalars if needed via providing a custom encode
options to Data.Yaml.encodeWith. So far two corner cases from yaml
itself (an empty scalar, and special strings) are omitted in the
implementation.
2019-05-12 07:44: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