parsec icon indicating copy to clipboard operation
parsec copied to clipboard

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

Open sol opened this issue 6 years ago • 1 comments

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?

sol avatar Mar 21 '18 03:03 sol

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

hvr avatar Mar 21 '18 19:03 hvr