[Haskell-cafe] Why is $ right associative instead of
leftassociative?
Brian Hulley
brianh at metamilk.com
Sun Feb 5 13:19:19 EST 2006
Tomasz Zielonka wrote:
> On Sun, Feb 05, 2006 at 01:10:24PM -0000, Brian Hulley wrote:
>> 2) Use "," instead of ";" in the block syntax so that all brace
>> blocks can be replaced by layout if desired (including record blocks)
>
> Wouldn't it be better to use ; instead of , also for record syntax?
I thought of this also, but the nice thing about using commas everywhere is
that it is consistent with tuples and lists:
[a,b,c]
(a,b,c)
{a,b,c}
I admit it takes some getting used to to write:
map f (h;t) = f h;map f t
but you couldn't use commas in tuple syntax if they were also used as list
cons.
Also, I'm using
test :{Eq a, Show a} a -> ()
instead of
test :: (Eq a, Show a) => a->()
and the comma here is particularly nice because it suggests a set, which is
exactly what the context is.
Regards, Brian.
More information about the Haskell-Cafe
mailing list