Dhall-haskell: [Feature Request] Tolerate missing lists and maps in yaml-to-dhall and json-to-dhall

Created on 9 Oct 2019  路  3Comments  路  Source: dhall-lang/dhall-haskell

From https://github.com/dhall-lang/dhall-kubernetes/issues/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.

Hacktoberfest enhancement jsoyaml

Most helpful comment

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.

All 3 comments

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

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)

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

quasicomputational picture quasicomputational  路  4Comments

vmchale picture vmchale  路  5Comments

mgajda picture mgajda  路  3Comments

aljce picture aljce  路  4Comments

Gabriel439 picture Gabriel439  路  7Comments