PROPOSAL: Include record puns in Haskell 2011
John Meacham
john at repetae.net
Wed Feb 24 16:01:38 EST 2010
On Wed, Feb 24, 2010 at 08:50:42PM +0000, Simon Marlow wrote:
> On 24/02/10 18:23, Ian Lynagh wrote:
> While I agree with these points, I was converted to record punning
> (actually record wildcards) when I rewrote the GHC IO library. Handle
> is a record with 12 or so fields, and there are literally dozens of
> functions that start like this:
>
> flushWriteBuffer :: Handle -> IO ()
> flushWriteBuffer Handle{..} = do
>
> if I had to write out the field names I use each time, and even worse,
> think up names to bind to each of them, it would be hideous.
>
> There are reasons to find this distasteful, yes, but I think the
> alternative is much worse.
>
> I'm not proposing record wildcards (yet) *cough* labelled-field
> wildcards, but punning is a step in the right direction.
Yes. I too have had this issue with jhc and am a big fan of GHC's field
wildcards. It is motivation enough for me to require a newer version of
ghc for compiling jhc. I'd support field wildcards in 2011, but would
understand if people thought it was too soon.
John
--
John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
More information about the Haskell-prime
mailing list