From: sof Date: Thu, 16 Sep 1999 09:17:25 +0000 (+0000) Subject: [project @ 1999-09-16 09:17:25 by sof] X-Git-Tag: Approximately_9120_patches~5800 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=55bea941c94b9bbd668208e5a5c6af0d6f79e692;p=ghc-hetmet.git [project @ 1999-09-16 09:17:25 by sof] NumExts.showListWith doc'ed --- diff --git a/ghc/docs/libraries/NumExts.sgml b/ghc/docs/libraries/NumExts.sgml index ca34f1c..29ed938 100644 --- a/ghc/docs/libraries/NumExts.sgml +++ b/ghc/docs/libraries/NumExts.sgml @@ -19,6 +19,8 @@ showIntAtBase :: Integral a -> (a -> Char) -- digit to char -> a -- number to show. -> ShowS + +showListWith :: (a -> ShowS) -> [a] -> ShowS Notes: @@ -42,8 +44,6 @@ Notes: could be defined - - showHex :: Integral a => a -> ShowS showHex n r = showString "0x" $ @@ -52,4 +52,21 @@ showHex n r = toChrHex d | d < 10 = chr (ord '0' + fromIntegral d) | otherwise = chr (ord 'a' + fromIntegral (d - 10)) + + + + + putStrLn (NumExts.showListWith NumExts.showHex [0..16]) + + + will print out the elements of