[Haskell-cafe] PROPOSAL: Record field type inference

John Meacham john at repetae.net
Thu Jun 5 23:17:13 UTC 2014

On Thu, Jun 5, 2014 at 2:20 AM, AntC <anthony_clayden at clear.net.nz> wrote:
> (I agree with you [John] in not seeing a great deal of similarity to the
> OverloadedRecordFields work. My earlier suggestion of not creating Selector
> functions is exactly to free up the namespace. That suggestion is part of (and
> largely orthogonal to) an alternative records proposal which also relies
> heavily on the type system.)

A simple backwards compatible extension would be to just not report an error
when there are multiple definitions of the same name when they are all
generated selectors. Then let name resolution happen like normal, just
reporting an ambiguous name if one is attempted to be used as a selector the
same way an ambiguous name is reported when there are multiple definitions
in scope for anything.

This would just require dropping the unique top level check. This would be
useful as the behavior will degrade to the current behavior if no field
names happen to overlap.


John Meacham - http://notanumber.net/

More information about the Haskell-Cafe mailing list