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 DuplicateRecordFields and OverloadedLabels.

For more information, see:

Content previously on this page has been moved to the SORF page.


Add ORF to the ticket's keywords to include it in these lists.

Open Tickets:

Implement TDNR
Interaction between ORF and record pattern synonyms needs to be resolved.
Unable to infer type when using DuplicateRecordFields
Allow applying type to label
Allow labels starting with uppercase with OverloadedLabels
Strange requirement for re-exported duplicate record fields
ghci :browse does not work with DuplicateRecordFields
-XDuplicateRecordFields breaks record expression splices
Field imposters with DuplicateRecordFields and NamedFieldPuns.
Move field name resolution to the type-checker
Add setField to HasField

Closed Tickets:

DuplicateRecordFields + TemplateHaskell
Fixity of field-deconstructors incorrect
Infix declarations for record fields with DuplicateRecordFields are broken
Interaction between ORF and record pattern synonyms needs to be resolved.
Auto complete in ghci shows $sel:function:Type for DuplicateRecordFields fields
Regression using NamedFieldPuns with qualified field names
DuplicateRecordFields appears not to work in GHCi
RebindableSyntax and OverloadedLabels
UnboxedTuple makes overloaded labels fail to parse
unused-top-binds wrongly warns about underscore-prefixed field names when DuplicateRecordFields enabled
Compilation fails with a panic: get_op runContT
record construction accepts local unqualified name instead of qualified imported name
GHC 8.2 gives misleading error message for out-of-scope infix type constructor
Can't Hide Field When DuplicateRecordFields Is Enabled
Initializing record with similarly named field from a different record results in warning rather than error
Panic when exporting duplicate record fields from separate modules
Identical distinct type family fields miscompiled



The extension was implemented in 2013 as a Google Summer of Code project, by Adam Gundry under the mentorship of Simon Peyton Jones.

Last modified 11 months ago Last modified on Jan 28, 2019 3:40:43 PM