Hello, (Malcolm, sorry for the double post, I forgot to CC the list) I was thinking mostly about the "old-time"-y punning, where I can write a label, say "theField", and it automatically gets expanded to "theField = theField", in record patterns and record constructing expressions.
The only corner case that I can remember about this is the interaction with qualified names, the issue being what happens if a label in a pun is qualified? I think that in such cases we should just used the unqualified form for the variable associated with the label. In patterns, I can't think of any other sensible alternative. In expressions, I could imaging expanding "A.theField" to "A.theField = A.theField" but it seems that this would almost never be what we want, while in all the uses I've had "A.theField = theField" is what was needed. I think that this is exactly what GHC implements, at least based on the following example: module A where data T = C { f :: Int } {-# LANGUAGE NamedFieldPuns #-} module B where import qualified A testPattern (A.C { A.f }) = f testExpr f = A.C { A.f } I imagine that this is fairly close to what was in Haskell 1.3? As far as wild-cards are concerned, I don't feel particularly strongly about them either way (I can see some benefits and some drawbacks) so I'd be happy to leave them for a separate proposal or add them to this one, depending on how the rest of the community feels. -Iavor On Wed, Feb 24, 2010 at 1:35 AM, Malcolm Wallace <malcolm.wall...@cs.york.ac.uk> wrote: >> I'd like to propose that we add record punning to Haskell 2011. > > Can you be more specific? Do you propose to re-instate punning exactly as > it was specified in Haskell 1.3? Or do you propose in addition some of the > newer extensions that have been recently implemented in ghc (but not other > compilers), such as record wildcards? > > Regards, > Malcolm > > _______________________________________________ > Haskell-prime mailing list > Haskell-prime@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-prime > _______________________________________________ Haskell-prime mailing list Haskell-prime@haskell.org http://www.haskell.org/mailman/listinfo/haskell-prime