[Haskell-cafe] Re: Pure Haskell Printf

Henning Thielemann iakd0 at clusterf.urz.uni-halle.de
Tue Nov 16 05:18:03 EST 2004


On 16 Nov 2004, Peter Simons wrote:

> Henning Thielemann writes:
> 
>  > Variable length argument lists are really a mess. Why are
>  > people so keen on them?
> 
> One advantage is that you need to type fewer characters.

I know memory is expensive, that's why only the last two digits of year
numbers are stored. :-]

> It's, well, not _that_ important, I'll readily admit. :-)

I'm afraid, that's the only reason. :-(

> Personally, I have found ShowS style text-formatting to be
> my favorite. The code
> 
>   verb = showString
>   msg  = (verb "i = ") . (12 `shows`) . (verb "\tj = ") $ "test"
> 
> isn't mind-blowingly compact either, but I always feel an
> odd satisfaction when writing this, because it's supposedly
> very efficient -- which justifies the extra characters,

You can save even more characters:

msg  = verb "i = " . shows 12 . verb "\tj = " $ "test"



More information about the Haskell-Cafe mailing list