Skip to content

How to distinguish between integers and natural numbers? #34

Description

@jchia

Is there a way to distinguish between integers and natural numbers when dumping? E.g. if I dump 4, it shows up as '4' instead of '+4' and that does not work if a reader using the Haskell binding expects an integer ('+4') instead of a natural number ('4').

Furthermore, if I dump [4, -4], I'll get '[4, -4]', which I think is not valid Dhall because 4 is a natural number but -4 is an integer and elements of a list needs to be the same type.

$ echo '[+4, -4]' | dhall
[ +4, -4 ]
$ echo '[4, -4]' | dhall

Use "dhall --explain" for detailed errors

Error: List elements should all have the same type

- Natural
+ Integer

1│     -4

(input):1:5

This is probably related to #1.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is neededrustPull requests that update Rust code

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions