Permitting trailing commas for record syntax ADT declarations

Alexander Berntsen alexander at plaimi.net
Mon Sep 22 16:13:34 UTC 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Friends,

I have a commit that allows for trailing and leading commas in record
updates, and it works fine. I think I now have gotten the hang of how
the parser is structured and generally works. GHCi output with my patch:

λ data Foo a b = MkFoo {foo :: a, bar :: b} deriving (Show)
λ (MkFoo {,foo = 2, bar = 3,}) {,foo=3,}
MkFoo {foo = 3, bar = 3}

I am happy to have a stab at all the other requests in this thread. I
will make small commits so that we can cherry-pick the ones we want.


We need to decide if we're going to sneak this into HEAD, or introduce
a language pragma (or one per structure that permits it). My vote goes
for the first-mentioned route, as this should be non-breaking changes
(if I do them correctly). Please cast your vote on the matter. :-]
- -- 
Alexander
alexander at plaimi.net
https://secure.plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iF4EAREIAAYFAlQgSq4ACgkQRtClrXBQc7WtfgD+I/K/Cy+aiaGZeGUUQC8yQthW
+wFf7+9sKX0dz0PktxgBAIVamPo/UhDLTgkFJOM03ro6OOC5i3Kb4/0YhsnTH/BP
=SPjR
-----END PGP SIGNATURE-----


More information about the ghc-devs mailing list