summaryrefslogtreecommitdiff
path: root/libraries/base/Numeric.hs
diff options
context:
space:
mode:
authorsimonmar <unknown>2003-07-16 10:55:20 +0000
committersimonmar <unknown>2003-07-16 10:55:20 +0000
commit78662c82e9eff64f375cc37e91d3c168a72765de (patch)
treeadec6df82ad42bc6dc1e0cd5768dc0cbea0a7867 /libraries/base/Numeric.hs
parent897b35b8711f98cb131ea3f4a69099c41f66ff5b (diff)
downloadhaskell-78662c82e9eff64f375cc37e91d3c168a72765de.tar.gz
[project @ 2003-07-16 10:55:20 by simonmar]
- Make showHex and showOct match the report (don't add leading "Ox" or "Oo"). - Remove showBin, which isn't specified by the report.
Diffstat (limited to 'libraries/base/Numeric.hs')
-rw-r--r--libraries/base/Numeric.hs24
1 files changed, 3 insertions, 21 deletions
diff --git a/libraries/base/Numeric.hs b/libraries/base/Numeric.hs
index 5603ae6c07..b21a98390e 100644
--- a/libraries/base/Numeric.hs
+++ b/libraries/base/Numeric.hs
@@ -30,7 +30,6 @@ module Numeric (
showIntAtBase, -- :: Integral a => a -> (a -> Char) -> a -> ShowS
showHex, -- :: Integral a => a -> ShowS
showOct, -- :: Integral a => a -> ShowS
- showBin, -- :: Integral a => a -> ShowS
showEFloat, -- :: (RealFloat a) => Maybe Int -> a -> ShowS
showFFloat, -- :: (RealFloat a) => Maybe Int -> a -> ShowS
@@ -155,23 +154,6 @@ showIntAtBase base toChr n r
if n' == 0 then r' else showIntAtBase base toChr n' r'
}
-showHex :: Integral a => a -> ShowS
-showHex n r =
- showString "0x" $
- showIntAtBase 16 (toChrHex) n r
- where
- toChrHex d
- | d < 10 = chr (ord '0' + fromIntegral d)
- | otherwise = chr (ord 'a' + fromIntegral (d - 10))
-
-showOct :: Integral a => a -> ShowS
-showOct n r =
- showString "0o" $
- showIntAtBase 8 (toChrOct) n r
- where toChrOct d = chr (ord '0' + fromIntegral d)
-
-showBin :: Integral a => a -> ShowS
-showBin n r =
- showString "0b" $
- showIntAtBase 2 (toChrOct) n r
- where toChrOct d = chr (ord '0' + fromIntegral d)
+showHex, showOct :: Integral a => a -> ShowS
+showHex = showIntAtBase 16 (intToDigit.fromIntegral)
+showOct = showIntAtBase 8 (intToDigit.fromIntegral)