$ yaml-to-dhall '{ foo : List Natural, bar : { baz : True } }' < example.yaml
Error: Invalid field type
I wonder why yaml-to-dhall doesn't show the source like dhall:
$ echo '{ foo : List Natural, bar : { baz : True } }' | dhall
Use "dhall --explain" for detailed errors
Error: Invalid field type
1│ { baz : True }
(stdin):1:29
In any case I think the short error message should include the field name.
@sjakobi: The reason it doesn't preserve the source is because Dhall.JSONToDhall.resolveSchemaToExpr (incorrectly) normalizes the resolved type before passing it to the next stage:
This is problematic for two reasons:
Looks like we simply forgot the type checking step hinted at by the haddock comment.