RE: Possible bug/omission in Numeric library?
28 Nov
2001
28 Nov
'01
3:29 p.m.
There is something strange about the Haskell'98 Numeric library, which I think could be considered a bug of sorts. There are functions
readDec, readOct, readHex :: (Integral a) => ReadS a
which read an integer from a string in base 10, 8, or 16, but there are no corresponding show functions to convert an integer to a string using base 8 or 16. The sole function given is
showInt :: (Integral a) => a -> ShowS
which shows a number in base 10 only. I think you'll agree that it is odd that you can read a certain number format but cannot show it?
Yes indeed. GHC and Hugs have showHex, showOct, showBin and showIntAtBase in NumExts: http://www.haskell.org/ghc/docs/latest/set/sec-numexts.html Cheers, Simon
9039
Age (days ago)
9039
Last active (days ago)
0 comments
1 participants
participants (1)
-
Simon Marlow