From: panne Date: Sun, 9 Jun 2002 14:20:06 +0000 (+0000) Subject: [project @ 2002-06-09 14:20:06 by panne] X-Git-Tag: nhc98-1-18-release~980 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=f87bde0dac8cf94db5b8cdac37c73c83fa7e0433;p=haskell-directory.git [project @ 2002-06-09 14:20:06 by panne] Use :%, not % for Inf/NaN, the latter would immediately lead to a runtime error. Note that isInfinite (read "Infinity" :: Float) or isInfinite (fromRational (1 :% 0)) still don't work, because fromRational is not OK for those cases. --- diff --git a/Text/Read/Lex.hs b/Text/Read/Lex.hs index 9dfd361..290072b 100644 --- a/Text/Read/Lex.hs +++ b/Text/Read/Lex.hs @@ -35,7 +35,7 @@ import GHC.Num( Num(..), Integer ) import GHC.Show( Show(.. ), showChar, showString, isSpace, isAlpha, isAlphaNum, isOctDigit, isHexDigit, toUpper ) -import GHC.Real( Ratio, Integral, Rational, (%), fromIntegral, fromRational, +import GHC.Real( Ratio(..), Integral, Rational, (%), fromIntegral, fromRational, toInteger, (^), (^^) ) import GHC.Float( Float, Double ) import GHC.List @@ -285,8 +285,8 @@ lexString = -- Lexing numbers infinity, notANumber :: Rational -infinity = 1 % 0 -notANumber = 0 % 0 +infinity = 1 :% 0 +notANumber = 0 :% 0 type Base = Int type Digits = [Int]