Permitting trailing commas for record syntax ADT declarations

Herbert Valerio Riedel hvriedel at gmail.com
Mon Sep 22 13:57:44 UTC 2014


On 2014-09-22 at 14:31:10 +0200, Alexander Berntsen wrote:
> Forwarding this & my reply to the ML as well,
>
>
> On 22/09/14 14:27, David Luposchainsky wrote:
>> +1. While you're at it, you may also want to consider allowing
>> leading commas for the folks that write their exports/records "the
>> other way round"
> Sure. Both styles are common in the wild, so that makes sense.

+1 (I'd even say that leading-comma style is the predominant one these
    days thanks to [1] et al.)


Let's be a bit more conrete. Where everywhere shall leading+trailing
commas be supported, here's a few places OTTOMH, where comma-separated
entities occur which may or may not benefit from this treatment:

 - list-syntax (+ even in pattern position?)

 - module import/export list

 - record syntax (+ patterns?)

 - pattern-guards

 - language pragmas

 - ...?


 [1]: https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md
 


More information about the ghc-devs mailing list