[Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

Tomasz Zielonka tomasz.zielonka at gmail.com
Fri Nov 18 02:23:27 EST 2005


On Fri, Nov 18, 2005 at 07:32:53AM +0100, Sebastian Sylvan wrote:
> On 11/18/05, John Meacham <john at repetae.net> wrote:
> > map (.foo) xs
> > to pull all the 'foo' fields out of xs.  (using made up syntax)
> 
> Well I suppose this is just a section on the selection operator?

So field labels are first-class citizens? Great!

> > map (foo_s 3) xs
> 
> This is trickier I think. I think I can live with "map (\r -> {r | s =
> 3})", though.

I think this special case could be treated specially, for example
    (\r -> {r | s = 3})
could be equivalent to
    {|s = 3}

Best regards
Tomasz


More information about the Haskell-Cafe mailing list