HORIZON HASKELLDocslts/ghc-10.0.xc62e4de2026-10-19Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · c62e4de · 2026-10-19

Modulelens-family-th-0.5.3.2Haskell2010

Lens.Family.THCore

The shared functionality behind Lens.Family.TH and Lens.Family2.TH.

  • 2 types
  • 3 values

By default, if the field name begins with an underscore, then the underscore will simply be removed (and the new first character lowercased if necessary).

valuederiveLenses
  1. :: (Name -> LensTypeInfo -> ConstructorFieldInfo -> Q [Dec])

    the signature deriver

  2. -> (String -> Maybe String)

    the name transformer

  3. -> Name
  4. -> Q [Dec]
#

The true workhorse of lens derivation. This macro is parameterized by a macro that derives signatures, as well as a function that filters and transforms names. Producing Nothing means that a lens should not be generated for the provided name.

valuemakeTraversals :: Name -> Q [Dec]
#

Derive traversals for each constructor in a data or newtype declaration, Traversals will be named by prefixing the constructor name with an underscore.

Example usage:

$(makeTraversals ''Foo)