
15 Sep
2011
15 Sep
'11
9:47 a.m.
On Thu, Sep 15, 2011 at 6:03 AM, Barney Hilken
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."