... | ... | @@ -12,7 +12,7 @@ For implementation status, see #18598, the tracking ticket for most recent work |
|
|
|
|
|
## GHC proposals and design discussions
|
|
|
|
|
|
Accepted GHC proposals:
|
|
|
### Accepted
|
|
|
|
|
|
- [Adding HasField class, changes to OverloadedLabels](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0002-overloaded-record-fields.rst) (Implemented in GHC 8.2 without `IsLabel x (r -> a)` instance)
|
|
|
- [NoFieldSelectors](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0160-no-toplevel-field-selectors.rst) (Implemented in GHC 9.2, see !4743)
|
... | ... | @@ -21,16 +21,19 @@ Accepted GHC proposals: |
|
|
- [Adding setField to HasField](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0042-record-set-field.rst) (Pending redesign and implementation, see #16232 and !3257)
|
|
|
- [Unrestricted Overloaded Labels](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0170-unrestricted-overloadedlabels.rst) (Draft implementation needs work, see #11671)
|
|
|
|
|
|
Proposals under review:
|
|
|
### Proposed
|
|
|
|
|
|
- [Relaxing HasField constraints](https://github.com/ocharles/ghc-proposals/blob/hasfield/proposals/0000-hasfield-incoherence.rst) (proposal under review)
|
|
|
- [Add warning for incomplete record selectors: proposal 516](https://github.com/adamgundry/ghc-proposals/blob/incomplete-record-selectors/proposals/0000-incomplete-record-selectors.rst) (proposal under review)
|
|
|
- [Relaxing HasField constraints](https://github.com/ocharles/ghc-proposals/blob/hasfield/proposals/0000-hasfield-incoherence.rst)
|
|
|
- [Add warning for incomplete record selectors: proposal 516](https://github.com/adamgundry/ghc-proposals/blob/incomplete-record-selectors/proposals/0000-incomplete-record-selectors.rst)
|
|
|
|
|
|
Planned design changes:
|
|
|
### Drafts
|
|
|
|
|
|
- [`HasField` redesign: split into two classes](https://github.com/adamgundry/ghc-proposals/blob/hasfield-redesign/proposals/0000-hasfield-redesign.rst)
|
|
|
- [Add type-changing update](https://github.com/adamgundry/ghc-proposals/blob/hasfield-redesign/proposals/0000-hasfield-type-changing-update.rst)
|
|
|
|
|
|
### Ideas
|
|
|
|
|
|
- Add a form of record update where the type is explicit (no proposal yet, see [discussion](https://github.com/ghc-proposals/ghc-proposals/discussions/506#discussioncomment-2868700))
|
|
|
- [`HasField` redesign: split into two classes](https://github.com/adamgundry/ghc-proposals/blob/hasfield-redesign/proposals/0000-hasfield-redesign.rst) (draft proposal)
|
|
|
- [Add type-changing update](https://github.com/adamgundry/ghc-proposals/blob/hasfield-redesign/proposals/0000-hasfield-type-changing-update.rst) (draft proposal)
|
|
|
- Clarify semantics of "functional" dependencies for use in `HasField`/`SetField` (initial thoughts on [Wiggly arrows](https://gitlab.haskell.org/ghc/ghc/-/wikis/Functional-dependencies-in-GHC/Wiggly-arrows) wiki page)
|
|
|
- Allow record pattern synonyms to solve `HasField` constraints (question around multi-constructor pattern synonyms: need pattern synonym collections?)
|
|
|
- Anonymous non-extensible records?
|
... | ... | @@ -38,7 +41,7 @@ Planned design changes: |
|
|
|
|
|
See also [this comment setting out a possible direction of travel](https://github.com/ghc-proposals/ghc-proposals/pull/510#issuecomment-1137887333).
|
|
|
|
|
|
Other related GHC proposals (not yet accepted):
|
|
|
### Other related GHC proposals
|
|
|
|
|
|
- [Separate HasField into GetField and SetField](https://github.com/tysonzero/ghc-proposals/blob/patch-3/proposals/separate-get-set-field.md)
|
|
|
- [Add GHC.Variants module to mirror GHC.Records](https://github.com/tysonzero/ghc-proposals/blob/ghc-variants/proposals/ghc-variants.md)
|
... | ... | |