HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulerecord-hasfield-1.0.1Haskell2010

GHC.Records.Extra

Extensions over a future version of GHC.Records. Provides the function modifyField plus the orphan instances:

  • HasField '(x1,x2) for selecting first the x1 field, then the x2 field. Available for () and tuples up to arity 5.

  • HasField "_1" (a,b) a for selecting the first compomnent of a pair, plus similarly for all fields up of all tuples up to arity 5.

Using these functions together you get:

modifyField @'("_1","_2") negate ((1,2),3,4,5) == ((1,-2),3,4,5)
  • 1 value

Orphan instances

19 instances