The Overloaded Record Fields family of extensions for GHC allow multiple record datatypes to share the same field names, and make it possible for type information to disambiguate selectors. In the design as implemented, there is no single
OverloadedRecordFields extension, but there are extensions for
For user-facing documentation, see the GHC user's guide:
For design details and implementation status, see:
#18598: tracking ticket for most recent work related to overloaded record fields.
- Adding setField to HasField (2018, being implemented for GHC 9.2, see #16232)
Adding HasField class, changes to OverloadedLabels (2016, implemented in GHC 8.2 without
IsLabel x (r -> a)instance)
Original design (2013)
Content previously on this page has been moved to the SORF page.
See the OverloadedRecordFields label.
- Prototype implementation of the magic typeclasses
Phab:D761, Phab:D1391, Phab:D1486, Phab:D1586, Phab:D1600:
- Phab:D1687, Phab:D2708: magic classes
!3257: extension of
HasFieldclass to support updates
The extension was initially implemented in 2013 as a Google Summer of Code project, by Adam Gundry under the mentorship of Simon Peyton Jones.