Record wildcard

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Mon Feb 5 09:09:25 EST 2007


Simon Peyton-Jones <simonpj at microsoft.com> wrote:

> | > Here's the complete record wildcard patch.
> |
> | Just to clarify, does ghc still accept the traditional record puns
> | (in both expressions and patterns) from Haskell 1.3, and this patch
> | merely augments puns to include wildcards?  Or are wildcarded-puns
> | the only kind that ghc now accepts?
> 
> Good qn.  At the moment GHC does not accept
>         f (C {f,g,h}) = ...
> but it's arguably a useful half-way house between
>         f (C {f=f,g=g,h=h}) = ...
> and
>         f (C {..}) = ...

Just to note (for completeness) that puns should work in expressions
too:
    let f = foo ...
        g = bar ...
    in C {f,g}

Since Hugs and nhc98/yhc do implement such puns, and they were once a
standard language feature, it seems a shame that ghc's new punning
extension does not.

Regards,
    Malcolm



More information about the Cvs-ghc mailing list