X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Numeric.hs;h=d55f9bb8459d8e12939ad1f5e17111c071505487;hb=2b626ac3e0e5eed595d7480bd18f14db875bb514;hp=b21a98390e7bb524db4e5a71eecbf01641a1ebad;hpb=2bdac8cfa0c4c01ce64db939ff2a77f16c57dfb5;p=ghc-base.git 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