printf

Simon Marlow simonmar at microsoft.com
Wed Nov 24 05:36:44 EST 2004


On 23 November 2004 20:34, Lennart Augustsson wrote:

> Being an old C programmer I'd like to suggest a library, Text.Printf,
> for C printf() style formatting.
> 
> For example
> 
>      do
> 	printf "Hello, world\n"
> 	printf "%s, cruel %s\n" "Goodbye" "world"
> 	printf "pi is about %10.8f\n" (pi::Double)
> 
> I have a Haskell 98 implementation of this function if people feel
> that it would be useful.

I'd like to pull this in, or something like it.  IMHO, the lack of
static type safety is outweighed by the shear convenience, and it's too
small to provide as a separate library.

It'd be nice to have 

  hPrintf :: (PrintfType a) -> Handle -> String -> a

too.

Cheers,
	Simon


More information about the Libraries mailing list