#5688: instance Read Integer/Rational/Double readsPrec out of memory and crash 
due
to exponential notation
---------------------------------+------------------------------------------
    Reporter:  gracjan           |       Owner:  igloo           
        Type:  bug               |      Status:  patch           
    Priority:  highest           |   Milestone:  7.4.1           
   Component:  libraries/base    |     Version:  6.12.3          
    Keywords:                    |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  Runtime crash   
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:                  
     Related:                    |  
---------------------------------+------------------------------------------

Comment(by maeder):

 I'm not happy, too. Representing all fractionals via `Exp` has some
 drawbacks. What does your patched `q` give for "420.00000"?

 {{{
 Prelude> 4.2000000 * 10 ** 2
 420.0
 Prelude> 42000000 * 10 ** (-5)
 420.00000000000006
 }}}

 I more liked Daniel's proposal: replacing the `Rat Rational` constructor
 with e.g. `RatExp Rational (Maybe Integer)`.

 Another point is, how such a literal is displayed in error messages by the
 patched ghc?

 {{{
 Prelude> 10.0 :: Integer
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5688#comment:29>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to