[Haskell-cafe] Pure Haskell Printf

Henning Thielemann iakd0 at clusterf.urz.uni-halle.de
Tue Nov 16 04:37:14 EST 2004


On Mon, 15 Nov 2004, John Goerzen wrote:

> Here are some examples:
> 
> vsprintf "Hello"
> > "Hello"
> vsprintf "Hello, %s\n" "John"
> > "Hello, John\n"
> vsprintf "%s, your age is %d\n" "John" (10::Integer)
> > "John, your age is 10\n"
> 
> sprintfAL "%(name)s, your age is %(age)d\n"
>   [("name", v "John"),
>    ("age", v (10::Integer))]
> > "John, your age is 10\n"
> 
> I would appreciate comments/critiques.

Variable length argument lists are really a mess. Why are people so keen
on them? What is the advantage over a plain list as single argument? Is
 vsprintf "%s, your age is %s\n" ["John", show (10::Integer)]
  really too complicated? 



More information about the Haskell-Cafe mailing list