Overloaded record fields meta-ticket
This is a meta-ticket covering the ongoing work on The Records Problem, in particular related to
RecordDotSyntax. See also issues labelled OverloadedRecordFields and the overloaded-record-fields wiki page.
The following pieces have implementations in flight:
GHC.Records(#16232, ghc-proposals#158). Implemented by @adamgundry (!3257) but stalled due to performance concerns. Planned next steps are documented at !3257 (comment 312762). @adamgundry is working on a GHC proposal to redesign
HasField, which is blocking this.
Planned code cleanup:
Issue #19783 (closed) tracks progress on changing representation ofdone
HsProjectionwhich is being worked on by @shayne-fletcher-da
Issue #19848 (closed) tracks progress on renamingdone
HsFieldBindand various related changes which is being worked on by @shayne-fletcher-da
Issues for the future:
Resolve issues around representing
DuplicateRecordFieldsin Template Haskell (#14848, #17381, #17551, #19664). This primarily requires investigation of the best way to represent field names in the TH AST, ideally a way that avoids losing information when it is known which datatype contains the field.
Continue improving dark corners of the renamer, i.e. the fact that mangled selector
Names are used to represent fields, so one must be very careful not to use the
OccNameas if it were meaningful to users). Avoid #13352, perhaps by reducing the reliance on name-mangling?
Warnings around partial fields (#18650).
HasFielderror messages (#18776).
Resolve the interaction between
DuplicateRecordFieldsand pattern synonyms (#11228 (closed), #14630 (closed), #17176 (closed), #18452 (closed)), and simplify some dark corners of the renamer (in particular the unsatisfactory representation of
GlobalRdrElt). Implemented by @adamgundry (!4467 (closed)). In GHC 9.2.
NoFieldSelectors(#5972 (closed), ghc-proposals#160). Initially implemented by @reactormonk and @fumieval (!4017 (closed)). Revised by @adamgundry (!4743 (closed)) along with extending
DisambiguateRecordFieldsto cover updates (#18999 (closed)) and fixing some bugs (#18729 (closed), #19213 (closed)). In GHC 9.2.
Record dot syntax (#18599 (closed), ghc-proposals#282). This has been split into
OverloadedRecordDot(which does not need
OverloadedRecordUpdate(which will require
RebindableSyntaxuntil we have
GHC.Records); see ghc-proposals#405. Implemented by @shayne-fletcher-da (!4532 (closed)). In GHC 9.2.