[Haskell-cafe] Usage of . and $

Thomas Davie tom.davie at gmail.com
Wed Mar 7 04:51:57 EST 2007


On 7 Mar 2007, at 09:44, Thomas Conway wrote:

> On 3/7/07, mm <schneegloeckchen at gmx.li> wrote:
>> > f . g . h $ x
>>
>> Alternativly,
>>
>> (f . g . h) x
>>
>> will work, too.
>
> It always irks me that you don't actually save any horizontal space
> using $. That is,
>    (e) x
> has the same number of characters (incl spaces) as
>    e $ x

I have to admit that I often use this form, rather than bracketing.   
My logic is not that it saves space (as you have demonstrated it  
doesn't), but instead that it makes my code easier to read and  
brackets easier to match -- I'd rather have the additional dollar  
signs than the additional brackets to count.

Bob


More information about the Haskell-Cafe mailing list