List syntax (was: Re: help from the community?)

Neil Mitchell ndmitchell at
Fri Feb 2 13:03:47 EST 2007


> The argument that a trailing comma "means" "the programmer forgot the
> last item" in a list / tuple is
> inconsistent with the deliberately explicit permissiveness of a
> trailing comma in the import / export lists.
> In the import / export lists such a trailing comma does not mean
> "programmer forgot additional thing at the end."

An import list is not a value, you can't examine whats in the list,
you can't enumerate it etc. As such, it doesn't really matter how many
elements are in there, the important thing is what the elements are.

A real list/tuple IS a value. A 3 element tuple is completely
different from a 4 element tuple.

Thats the difference, there is a real semantic difference - its not a
case of inconsistency.

Personally I'd make the rule that trailing commas are never allowed,
anywhere, but I do see an argument for adding them to import lists.



More information about the Haskell-prime mailing list