From ba85754a049791ee795ba887e698523f1885d3f3 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Thu, 1 Mar 2012 14:05:36 +0000 Subject: Make "100e12" not parse as an Integer; part of #5688 The report says that it isn't meant to. --- libraries/base/Text/Read/Lex.hs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'libraries/base/Text/Read') 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 -- cgit v1.2.1