[Haskell-cafe] Inconsistent trailing comma in export list and record syntax

L Corbijn aspergesoepje at gmail.com
Mon Jul 11 10:49:02 CEST 2011


Hello,

I'm wondering why the trailing comma is allowed in export syntax, but not in
record syntax, here an example
module Foo (
    export1, -- is allowed
) where

data Type = Type  {
    record1 :: Foo, -- is not allowed
}

To me this seems quite inconsistent and sometimes quite frustrating, imagine
the case that you want to temporarily remove the last record:
data Type = Type  {
    record1 :: Foo,
--    record2 :: Bar
}
this would fail due to an extra comma that has to be commented out.

You could of course say that I'm using a bad style, but it remains that it
seems to be inconsistent to allow a trailing comma in one place and not in
the other. So is there an reason for this?

Lars Corbijn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110711/524d127a/attachment.htm>


More information about the Haskell-Cafe mailing list