[GHC] #7045: The `Read` instance of `Rational` does not support exponential notation (was: the compiler and the library functions should read literals in the same way)
GHC
cvs-ghc at haskell.org
Tue Jul 3 16:55:58 CEST 2012
#7045: The `Read` instance of `Rational` does not support exponential notation
-------------------------------+--------------------------------------------
Reporter: maeder | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.6.1
Component: libraries/base | Version: 7.4.2
Resolution: | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Difficulty: Unknown
Testcase: | Blockedby:
Blocking: | Related: #7044, #5692
-------------------------------+--------------------------------------------
Changes (by pcapriotti):
* milestone: => 7.6.1
Comment:
We can change that they are converted to `Rational` internally, but not
that they are ultimately converted to `Fractional a => a`, since that's a
visible and non-backwards compatible change.
Since `Rational` has a `Fractional` instance, I think `1e10 :: Rational`
should be accepted. The fact that you can blow the compiler up by giving
it a big exponent is indeed a problem, but that's tracked by #5692 (and I
believe the solution is to make it "fail" at runtime).
However, we can keep this ticket as a feature request for the `Read`
instance of `Rational`.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7045#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list