diff options
author | Ian Lynagh <igloo@earth.li> | 2012-03-01 14:05:36 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2012-03-01 14:06:13 +0000 |
commit | ba85754a049791ee795ba887e698523f1885d3f3 (patch) | |
tree | 8199fa64cc7256a3bf81a6ed7d61ffa90f9f26cb /libraries/base/Text/Read/Lex.hs | |
parent | 81b6141a3f4101ed5abc1f65d53823edc2b7373d (diff) | |
download | haskell-ba85754a049791ee795ba887e698523f1885d3f3.tar.gz |
Make "100e12" not parse as an Integer; part of #5688
The report says that it isn't meant to.
Diffstat (limited to 'libraries/base/Text/Read/Lex.hs')
-rw-r--r-- | libraries/base/Text/Read/Lex.hs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/libraries/base/Text/Read/Lex.hs b/libraries/base/Text/Read/Lex.hs index ac6ec68f7e..7ae8e9f986 100644 --- a/libraries/base/Text/Read/Lex.hs +++ b/libraries/base/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 |