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

Sebastian Sylvan sebastian.sylvan at gmail.com
Fri Nov 18 01:32:53 EST 2005


On 11/18/05, John Meacham <john at repetae.net> wrote:
> another thing is that for any record syntax, we would want higher order
> versions of the selection, setting, and updating routines. A quick
> perusal of my source code shows over half my uses of record selectors
> are in a higher order fashion. (which need to be generated with DrIFT
> with the current syntax)
>
> I mean something like
>
> 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?

> map (foo_s 3) xs

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


--
Sebastian Sylvan
+46(0)736-818655
UIN: 44640862


More information about the Haskell-Cafe mailing list