Preface_stdlib.EitherImplementation for Either.t.
Either.t is the simplest sum type. In addition to allowing the generic description of sum types, it allows the description of a disjunction, for example to generalise a conditional branching.
The set of concrete implementations for Either.t.
module Bifunctor : Preface_specs.BIFUNCTOR with type ('a, 'b) t = ('a, 'b) tBy setting the left type of Either.t it is possible to get implementations for abstractions on constructors of type with an arity of 1.
module Functor
(T : Preface_specs.Types.T0) :
Preface_specs.FUNCTOR with type 'a t = (T.t, 'a) Bifunctor.tmodule Alt
(T : Preface_specs.Types.T0) :
Preface_specs.ALT with type 'a t = (T.t, 'a) Bifunctor.tEither.t implements Preface_specs.APPLICATIVE and introduces an interface to define Preface_specs.TRAVERSABLE using Either as an iterable structure.
module Applicative
(T : Preface_specs.Types.T0) :
Preface_specs.Traversable.API_OVER_APPLICATIVE
with type 'a t = (T.t, 'a) Bifunctor.tmodule Selective
(T : Preface_specs.Types.T0) :
Preface_specs.SELECTIVE with type 'a t = (T.t, 'a) Bifunctor.tEither.t implements Preface_specs.MONAD and introduces an interface to define Preface_specs.TRAVERSABLE using Either as an iterable structure.
module Monad
(T : Preface_specs.Types.T0) :
Preface_specs.Traversable.API_OVER_MONAD
with type 'a t = (T.t, 'a) Bifunctor.tmodule Invariant
(T : Preface_specs.Types.T0) :
Preface_specs.INVARIANT with type 'a t = (T.t, 'a) Bifunctor.tmodule Foldable
(T : Preface_specs.Types.T0) :
Preface_specs.FOLDABLE with type 'a t = (T.t, 'a) Bifunctor.tAdditional functions to facilitate practical work with Either.t.
val pure : 'b -> ('a, 'b) tCreate a value from 'b to ('a, 'b) t, a value wrapped in Right.
Equality between Either.t.
val pp :
(Stdlib.Format.formatter -> 'a -> unit) ->
(Stdlib.Format.formatter -> 'b -> unit) ->
Stdlib.Format.formatter ->
('a, 'b) t ->
unitFormatter for pretty-printing for Either.t.