... | ... | @@ -4,7 +4,7 @@ The Overloaded Record Fields family of extensions for GHC allow multiple record |
|
|
* `OverloadedLabels` (GHC 8.0.1): provides `#field` syntax for an identifier whose meaning is determined by typeclass instance resolution. Intended for use with the `HasField` magic type class (GHC 8.2.1).
|
|
|
* `NoFieldSelectors` (GHC 9.2.1): prevents fields being in scope as selector functions.
|
|
|
* `OverloadedRecordDot` (GHC 9.2.1): permits `expression.field` syntax for record projection, using `getField` from `HasField`.
|
|
|
* `OverloadedRecordUpdate` (partially in GHC 9.2.1): generalises `r { f = x }` to use `setField` (yet to be added to `HasField`), and additionally permits `r { f1.f2 = x }`.
|
|
|
* `OverloadedRecordUpdate` (partially in GHC 9.2.1 but requires `RebindableSyntax`): generalises `r { f = x }` to use `setField` (yet to be added to `HasField`), and additionally permits `r { f1.f2 = x }`.
|
|
|
|
|
|
For user-facing documentation, see the [GHC user's guide](https://downloads.haskell.org/ghc/latest/docs/html/users_guide/exts/records.html).
|
|
|
|
... | ... | @@ -12,19 +12,22 @@ For implementation status, see #18598, the tracking ticket for most recent work |
|
|
|
|
|
## GHC proposals and design discussions
|
|
|
|
|
|
### Accepted
|
|
|
### Implemented
|
|
|
|
|
|
- [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)
|
|
|
- [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)
|
|
|
- [RecordDotSyntax](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0282-record-dot-syntax.rst) (amended by [ghc-proposals#405](https://github.com/ghc-proposals/ghc-proposals/pull/405) and implemented in GHC 9.2)
|
|
|
- [DuplicateRecordFields without ambiguous field access](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0366-no-ambiguous-field-access.rst) (implemented for fields in GHC 9.2, not yet implemented for updates, see #19461)
|
|
|
- [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) (implemented in GHC 9.6, see #11671, !8966)
|
|
|
|
|
|
## Accepted but not yet (fully) implemented
|
|
|
|
|
|
- [DuplicateRecordFields without ambiguous field access](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0366-no-ambiguous-field-access.rst) (implemented for fields in GHC 9.2, not yet implemented for updates, see #19461)
|
|
|
- [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)
|
|
|
- [Add warning for incomplete record selectors: proposal #516](https://github.com/adamgundry/ghc-proposals/blob/incomplete-record-selectors/proposals/0000-incomplete-record-selectors.rst) (accepted but not yet implemented, see #18650)
|
|
|
|
|
|
### Proposed
|
|
|
|
|
|
- [Relaxing `HasField` constraints](https://github.com/ocharles/ghc-proposals/blob/hasfield/proposals/0000-hasfield-incoherence.rst) (awaiting committee decision)
|
|
|
- [Relaxing `HasField` constraints](https://github.com/ocharles/ghc-proposals/blob/hasfield/proposals/0000-hasfield-incoherence.rst) (being revised)
|
|
|
- [Disambiguating record updates using type signatures](https://github.com/adamgundry/ghc-proposals/blob/disambiguating-record-updates-using-type-signatures/proposals/0000-disambiguating-record-updates-using-type-signatures.rst) (under discussion)
|
|
|
|
|
|
|
... | ... | |