package preface
Module Preface_stdlib.EitherSource
Implementation 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.
Type
Implementation
The set of concrete implementations for Either.t.
Bifunctor
module Bifunctor : Preface_specs.BIFUNCTOR with type ('a, 'b) t = ('a, 'b) tDelayed implementation
By setting the left type of Either.t it is possible to get implementations for abstractions on constructors of type with an arity of 1.
Functor
module Functor
(T : Preface_specs.Types.T0) :
Preface_specs.FUNCTOR with type 'a t = (T.t, 'a) Bifunctor.tAlt
module Alt
(T : Preface_specs.Types.T0) :
Preface_specs.ALT with type 'a t = (T.t, 'a) Bifunctor.tApplicative
Either.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.tMonad
Either.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.tFoldable
module Foldable
(T : Preface_specs.Types.T0) :
Preface_specs.FOLDABLE with type 'a t = (T.t, 'a) Bifunctor.tAddtional functions
Additional functions to facilitate practical work with Either.t.
Equality between Either.t.
val pp :
(Format.formatter -> 'a -> unit) ->
(Format.formatter -> 'b -> unit) ->
Format.formatter ->
('a, 'b) t ->
unitFormatter for pretty-printing for Either.t.