[Haskell-cafe] A backwards-compatible record proposal

Brian Hulley brianh at metamilk.com
Sat Aug 19 04:39:45 EDT 2006

Brian Hulley wrote:
> In the module containing the data decl for the record, the compiler
> inserts the following:
>    instance (.x) (Vector3 a) a where
>        (.x) v = ... -- compiler generated code to access the field

instance (.x) (Vector3 a) a where
    (.x) Vector3{.x = x} = x

More information about the Haskell-Cafe mailing list