Records in Haskell
J. Garrett Morris
jgmorris at cs.pdx.edu
Thu Sep 15 15:47:37 CEST 2011
On Thu, Sep 15, 2011 at 6:03 AM, Barney Hilken <b.hilken at ntlworld.com> wrote:
> The right way to deal with records is first to agree a mechanism for
> writing a context which means
>
> "a is a datatype with a field named n of type b"
>
> then give the selector n the type
>
> "a is a datatype with a field named n of type b" => n :: a -> b
>
> There is no reason why this shouldn't be used with the current syntax
> (although it might clash with more advanced features like first-class
> labels).
Trex is one existing approach in the Haskell design space
http://web.cecs.pdx.edu/~mpj/pubs/polyrec.html
http://web.cecs.pdx.edu/~mpj/pubs/lightrec.html
/g
--
"I’m surprised you haven’t got a little purple space dog, just to ram
home what an intergalactic wag you are."
More information about the Glasgow-haskell-users
mailing list