Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change YAML/JSON encoding for NaN/Infinity/-Infinity #946

Merged
merged 2 commits into from May 12, 2019

Conversation

Gabriella439
Copy link
Collaborator

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.

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.
@Gabriella439
Copy link
Collaborator Author

Note that #941 removes dhall-json from the stack-lts-6.yaml build, which should fix the Appveyor build failure for this pull request once that is merged

@Gabriella439 Gabriella439 merged commit 8139c36 into master May 12, 2019
@Gabriella439 Gabriella439 deleted the gabriel/special_doubles branch May 12, 2019 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant