[commit: base] master: Make "100e12" not parse as an Integer; part of #5688 (bed3d79)
Ian Lynagh
igloo at earth.li
Thu Mar 1 17:24:31 CET 2012
Repository : ssh://darcs.haskell.org//srv/darcs/packages/base
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/bed3d7937bea1619f7cf05af8babd8dd4385f348
>---------------------------------------------------------------
commit bed3d7937bea1619f7cf05af8babd8dd4385f348
Author: Ian Lynagh <igloo at earth.li>
Date: Thu Mar 1 14:05:36 2012 +0000
Make "100e12" not parse as an Integer; part of #5688
The report says that it isn't meant to.
>---------------------------------------------------------------
Text/Read/Lex.hs | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/Text/Read/Lex.hs b/Text/Read/Lex.hs
index ac6ec68..7ae8e9f 100644
--- a/Text/Read/Lex.hs
+++ b/Text/Read/Lex.hs
@@ -79,12 +79,7 @@ data Number = MkNumber Int -- Base
numberToInteger :: Number -> Maybe Integer
numberToInteger (MkNumber base iPart) = Just (val (fromIntegral base) 0 iPart)
-numberToInteger (MkDecimal iPart Nothing mExp)
- = let i = val 10 0 iPart
- in case mExp of
- Nothing -> Just i
- Just exp | exp >= 0 -> Just (i * (10 ^ exp))
- _ -> Nothing
+numberToInteger (MkDecimal iPart Nothing Nothing) = Just (val 10 0 iPart)
numberToInteger _ = Nothing
numberToRational :: Number -> Rational
More information about the Cvs-libraries
mailing list