Possible bug/omission in Numeric library?

Simon Marlow simonmar@microsoft.com
Wed, 28 Nov 2001 15:29:54 -0000

> 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) =3D> 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) =3D> 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: