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

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Moduleeither-n-0.1.0.0Haskell2010

Data.Lens.Injection.Injection7

The seventh injection of a sum type, as a prism. The sum-type dual of Control.Lens.Field7.

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

Access the seventh constructor of a sum type.

Where Control.Lens._7 is the seventh projection out of a product, _I7 is the seventh injection into a sum.

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

Example3 expressions
data T = C1 | C2 | C3 | C4 | C5 | C6 | C7 Int | C8 deriving (Show, Generic)instance Injection7 T T Int IntC7 1 ^? _I7Just 1
Example1 expression
C8 ^? _I7Nothing
Example1 expression
_I7 # 1 :: TC7 1

Methods