From f87bde0dac8cf94db5b8cdac37c73c83fa7e0433 Mon Sep 17 00:00:00 2001 From: panne Date: Sun, 9 Jun 2002 14:20:06 +0000 Subject: [PATCH] [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. --- Text/Read/Lex.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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] -- 1.7.10.4