
On Wed, Jan 21, 2015 at 11:48 AM, Simon Marlow
2) Anonymous records are nice to have, but I don't want to have all
records be anonymous (and have to jump through newtype hoops to get back non-anonymous records.)
So right now you have to say
data T = R { a :: Int }
and with anonymous records you could say
data T = R {| a :: Int |}
(or something similar). That doesn't seem like jumping through hoops, it's exactly the same amount of syntax. If you're worried about the extra layer of boxing (quite reasonable) then either (a) use a newtype, if possible, or (b) we could consider automatic UNPACKing of records used in a constructor argument.
In the first of these declarations, we automatically have: a :: T -> Int Do we get that automatically in the second? Or do we have to write out all the field accessors, etc. we want to derive on T (and, can we do that)? I assume things like that are the concern for "non-anonymous records." -- Dan