Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,399
    • Issues 5,399
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 590
    • Merge requests 590
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Merge requests
  • !4017

Implement NoFieldSelectors

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Fumiaki Kinoshita requested to merge fumieval/ghc:fieldselectors-fumieval into master Sep 10, 2020
  • Overview 131
  • Commits 43
  • Pipelines 53
  • Changes 48

Thank you for your contribution to GHC!

Please take a few moments to verify that your commits fulfill the following:

  • are either individually buildable or squashed
  • have commit messages which describe what they do (referring to Notes and tickets using #NNNN syntax when appropriate)
  • have added source comments describing your change. For larger changes you likely should add a Note and cross-reference it from the relevant places.
  • add a testcase to the testsuite.
  • This MR implements the NoFieldSelectors proposal.

Summary of the changes

(Items with bold texts are the key parts of the implementation.)

  • A new language extension, FieldSelectors, is added and enabled by default.
  • NoFieldSelectors negates FieldSelectors.
  • We added a new field in FieldLabel indicating whether FieldSelectors is enabled in the definition. As a result, we had to update the use sites of FieldLabel.
  • Previously, whether DuplicateRecordFields is in effect is represented by Bool; we replaced it by an explicit datatype instead.
  • lookupOccRn_overloaded has been renamed to lookupOccRn_overloaded_expr.
    • It is used to look up variables in expressions.
    • Selector functions created with NoFieldSelectors are hidden from this function.
  • lookupGlobalOccRn_overloaded has been renamed to lookupGlobalOccRn_overloaded_pat.
    • It is used to find field names in record patterns, updates, and constructions.
    • It can find selector functions with NoFieldSelectors.
  • Created a new datatype LookupOccRnOverloadedResult in place of Either Name [Name]
  • Fixed the bug #18729 (closed) preventing it work on GHCi
Edited Feb 16, 2021 by Adam Gundry
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fieldselectors-fumieval