HORIZON HASKELLDocslts/ghc-9.14.x45dd5372026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Moduleeither-n-0.1.0.0Haskell2010

Data.Lens.Injection.Injection6

The sixth injection of a sum type, as a prism. The sum-type dual of Control.Lens.Field6.

  • 1 class
  • Packageeither-n-0.1.0.0
  • Exports1
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceInjection6.hs
classclass Injection6 s t a b | s -> a, t -> b, s b -> t, t a -> s where
#

Access the sixth constructor of a sum type.

Where Control.Lens._6 is the sixth projection out of a product, _I6 is the sixth injection into a sum.

The default implementation is the prism to the sixth constructor of a Generic type, injection (Proxy :: Proxy 5).

Example3 expressions
data T = C1 | C2 | C3 | C4 | C5 | C6 Int | C7 deriving (Show, Generic)instance Injection6 T T Int IntC6 1 ^? _I6Just 1
Example1 expression
C7 ^? _I6Nothing
Example1 expression
_I6 # 1 :: TC6 1

Methods