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

Package0.1.0.0Data

either-n

Data types like Either but with more constructors

Modules

25 modules
Internal modules · 1

Description

Data types like Either but with more constructors, and optics for the constructors of any sum type.

Either3 a b c is a value of one of three types, with the constructors First3, Second3 and Third3. The Functor, Applicative and Monad instances act on the third type parameter, so First3 and Second3 short-circuit, in the same way Left does for Either.

Either3T f a b c is an Either3 inside a type constructor f, in the same way that ExceptT e m a is m (Either e a). Use _Wrapped to convert between Either3T f a b c and f (Either3 a b c). The mtl classes are lifted from f.

Data.Lens.Injection provides the classes Injection1 to Injection19, the sum-type duals of Field1 to Field19 from lens. Where _1 is a lens to the first field of a product, _I1 is a prism to the first constructor of a sum. Each class has a default implementation for any type with a Generic instance.

Depends on

7 packages

Used by in this set · 1