From: simonmar Date: Mon, 21 Jul 2003 09:26:23 +0000 (+0000) Subject: [project @ 2003-07-21 09:26:23 by simonmar] X-Git-Tag: nhc98-1-18-release~588 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=b539ec83a70567b0b8d1fddf99b09e072ab8c23e;p=haskell-directory.git [project @ 2003-07-21 09:26:23 by simonmar] Fix showIntAtBase to match the report. Its signature was previously showIntAtBase :: Integral a => a -> (a -> Char) -> a -> ShowS and is now: showIntAtBase :: Integral a => a -> (a -> Char) -> a -> ShowS --- diff --git a/Numeric.hs b/Numeric.hs index b21a983..d55f9bb 100644 --- a/Numeric.hs +++ b/Numeric.hs @@ -141,12 +141,12 @@ showGFloat d x = showString (formatRealFloat FFGeneric d x) -- --------------------------------------------------------------------------- -- Integer printing functions -showIntAtBase :: Integral a => a -> (a -> Char) -> a -> ShowS +showIntAtBase :: Integral a => a -> (Int -> Char) -> a -> ShowS showIntAtBase base toChr n r | n < 0 = error ("Numeric.showIntAtBase: applied to negative number " ++ show n) | otherwise = case quotRem n base of { (n', d) -> - let c = toChr d in + let c = toChr (fromIntegral d) in seq c $ -- stricter than necessary let r' = c : r @@ -155,5 +155,5 @@ showIntAtBase base toChr n r } showHex, showOct :: Integral a => a -> ShowS -showHex = showIntAtBase 16 (intToDigit.fromIntegral) -showOct = showIntAtBase 8 (intToDigit.fromIntegral) +showHex = showIntAtBase 16 intToDigit +showOct = showIntAtBase 8 intToDigit