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

How to distinguish between integers and natural numbers? #34

Open
jchia opened this issue Aug 8, 2021 · 1 comment
Open

How to distinguish between integers and natural numbers? #34

jchia opened this issue Aug 8, 2021 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed rust Pull requests that update Rust code

Comments

@jchia
Copy link

jchia commented Aug 8, 2021

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.

@s-zeng s-zeng added bug Something isn't working help wanted Extra attention is needed rust Pull requests that update Rust code labels Sep 13, 2021
@s-zeng
Copy link
Owner

s-zeng commented Sep 13, 2021

I'm working on something to fix this and #1, though I'm a bit busy for the next while. Expect something from me maybe around October, unless someone needs this urgently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed rust Pull requests that update Rust code
Projects
None yet
Development

No branches or pull requests

2 participants