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

[Feature Request] Tolerate missing lists and maps in yaml-to-dhall and json-to-dhall #1410

Closed
akshaymankar opened this issue Oct 9, 2019 · 3 comments · Fixed by #1414
Closed

Comments

@akshaymankar
Copy link
Contributor

From dhall-lang/dhall-kubernetes#83

When I try to run yaml-to-dhall {x : Text, y : List Text} on this yaml:

x: "some text"

It of course complains that y is missing. Correct type for this would be {x : Text, y : Optional (List Text)}, but this can become too noisy even if a few a lists are optional. This is true especially in proejcts like dhall-kubernetes where (almost?) all the lists are optional. The same applies to maps.

It would be nice to if yaml-to-dhall had a flag to tolerate missing lists and maps and assume empty values. It would also be the opposite of --omitEmpty of dhall-to-yaml and would allow such YAML files to re-interpreted as Dhall.

@sjakobi
Copy link
Collaborator

sjakobi commented Oct 9, 2019

What would be a good name for this option? --allow-empty?

@Gabriella439
Copy link
Collaborator

One minor suggestion: see if there is an option name we can use for both directions for consistency (e.g. --omittable-lists or something like that)

akshaymankar added a commit to akshaymankar/dhall-haskell that referenced this issue Oct 10, 2019
@akshaymankar
Copy link
Contributor Author

I am not super fussed about it, but I found out that 'omissible' is probably more accepted word than 'omittable'.
One well respected dictionary has 'omittable' compared to 19 for 'omissible'. So maybe the flag should be called --omissible-lists?

About consistency though, dhall-to-* binaries have CamelCase names but *-to-dhall binaries have train-case, it would be really nice if they that was not the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants