Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Text.Parsec.Language.haskell incorrectly parses floating literal as Double #89

Open
sol opened this issue Mar 21, 2018 · 1 comment
Open

Comments

@sol
Copy link
Member

sol commented Mar 21, 2018

According to the Haskell 2010 Language Report floating literal should be parsed as Rational. However Text.Parsec.Language.haskell parses them as Double.

To fix this we would need to change the types of TokenParser.float and TokenParser.naturalOrFloat from Double to Rational. This is a breaking change that will also affect other language definitions. Is that an option?

@hvr
Copy link
Member

hvr commented Mar 21, 2018

hrm... what about generalising to Fractional r =>?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants