X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Numeric.hs;fp=Numeric.hs;h=d55f9bb8459d8e12939ad1f5e17111c071505487;hb=b539ec83a70567b0b8d1fddf99b09e072ab8c23e;hp=b21a98390e7bb524db4e5a71eecbf01641a1ebad;hpb=32db97748d339d778f56886be07c0e38a8bdbd9a;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