Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,393
    • Issues 4,393
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 381
    • Merge Requests 381
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #18598

Closed
Open
Opened Aug 21, 2020 by Adam Gundry@adamgundryDeveloper4 of 5 tasks completed4/5 tasks

Overloaded record fields meta-ticket

This is a meta-ticket covering the ongoing work on The Records Problem, in particular related to DuplicateRecordFields, NoFieldSelectors and RecordDotSyntax. See also issues labelled OverloadedRecordFields and the overloaded-record-fields wiki page.

The following pieces have implementations in flight:

  • Adding setField to 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:

  • Refactor GHC.Types.Name.Reader (#19116).

  • Remove AmbiguousFieldOcc and simplify field name resolution in accordance with ghc-proposals#366 (#19461).

    • Issue #19720 tracks progress on removal of AmbiguousFieldOcc from HsRecFld which is being worked on by @shayne-fletcher-da
  • Simplify the representation of RecordUpd for OverloadedRecordUpdate following !4532 (closed). See Refactor RecordUpd syntax (#19463).

Issues for the future:

  • Fix bugs in GHCi related to DuplicateRecordFields (#13438, #19314 (closed), #19322 (closed)).

  • Resolve issues around representing DuplicateRecordFields in 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 Name's OccName as if it were meaningful to users). Avoid #13352, perhaps by reducing the reliance on name-mangling?

  • Warnings around partial fields (#18650).

  • Improve HasField error messages (#18776).

  • Improve DuplicateRecordFields error messages (#14892, #17420, #17469).

  • Refactor RecordUpd syntax (#19463)

Already done:

  • Resolve the interaction between DuplicateRecordFields and 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 DisambiguateRecordFields to cover updates (#18999 (closed)) and fixing some bugs (#18729 (closed), #19213 (closed)). In GHC 9.2.

  • Add -Wambiguous-fields (#18966 (closed), ghc-proposals#366). Implemented by @adamgundry (!4770 (closed)). In GHC 9.2.

  • Record dot syntax (#18599 (closed), ghc-proposals#282). This has been split into OverloadedRecordDot (which does not need setField) and OverloadedRecordUpdate (which will require RebindableSyntax until we have setField in GHC.Records); see ghc-proposals#405. Implemented by @shayne-fletcher-da (!4532 (closed)). In GHC 9.2.

Edited Apr 18, 2021 by Shayne Fletcher
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#18598