List syntax (was: Re: help from the community?)
Douglas Philips
dgou at mac.com
Tue Feb 6 22:17:03 EST 2007
On 2007 Feb 5, at 6:13 AM, Ulf Norell wrote:
> How about instead writing
>
> ( expr
> , expr
> , expr
> , expr
> , expr
> )
>
> The only extra work is when inserting an element at the beginning,
> but you have the same problem in your example.
This a coding style issue. My point was that the syntax should not be
inconsistently enforcing style, which it is, unless there is some
payoff (which there doesn't seem to be).
I argue for making trailing commas optional everywhere that commas
are used to separate items in a grouping (though the syntax snippets
I've posted before were only a few of those places, such as in tuples
and lists).
Enforcing style is not always bad, and layout has some great things
going for it. Layout is also flexible where
it doesn't need to be rigid. Given the experience with trailing
commas in other languages, even some that support
a glimmer of functional programming :-), being rigid in this area
doesn't seem to have a counterbalancing payoff...
I really like Brian Hulley's layout proposal:
<http://www.haskell.org/haskellwiki/Accessible_layout_proposal>
because it means I can abandon commas and other syntax noise
altogether and thus moot the issue.
--D'gou
More information about the Haskell-prime
mailing list