> Michael Marte wrote:
> 
> > I have a simple problem but it seems to be quite involved: I want to print
> > floating point numbers with a given number of decimal points.
> >
> > First, I found out that both ghc and hugs do not consider the precision
> > argument to showPrec.
> 
> What precision argument?  There's a precedence argument, but the precision
> is news to me...

The library report defines:

class  Show a  where
    showsPrec :: Int -> a -> ShowS
    show      :: a -> String 
    showList  :: [a] -> ShowS

    showsPrec _ x s   = show x ++ s
    show x        = showsPrec 0 x ""

I always thought that the Int argument to showsPrec is the precision.
So what is it good for? The library report does not explain it.

Michael




Reply via email to