record-hasfield: A version of GHC.Records as available in future GHCs.

[ bsd3, development, library ] [ Propose Tags ]

This package provides a version of GHC.Records as it will be after the implementation of GHC proposal #42, plus some helper functions over it.

[Skip to Readme]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS] 1.0, 1.0.1
Change log CHANGES.txt
Dependencies base (>=4.4 && <5) [details]
License BSD-3-Clause
Copyright Adam Gundry and Neil Mitchell 2018-2024
Author Neil Mitchell <>
Maintainer Neil Mitchell <>
Category Development
Home page
Bug tracker
Source repo head: git clone
Uploaded by NeilMitchell at 2024-01-21T09:32:37Z
Distributions LTSHaskell:1.0.1, NixOS:1.0.1, Stackage:1.0.1
Reverse Dependencies 6 direct, 2 indirect [details]
Downloads 3652 total (56 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-01-21 [all 1 reports]

Readme for record-hasfield-1.0.1

[back to package description]

record-hasfield Hackage version Stackage version Build status

This package provides a version of "GHC.Records" as it will be after the implementation of GHC proposal #42, which reads:

-- | Constraint representing the fact that the field @x@ can be get and set on
--   the record type @r@ and has field type @a@.
class HasField x r a | x r -> a where
    -- | Function to get and set a field in a record.
    hasField :: r -> (a -> r, a)

In GHC these will be magically solved, but this package doesn't provide that. This package does provide extra helper functions for working with the HasField type class.