Module Preface_specs

Set of interfaces describing all the abstractions available in Preface. For a detailed description of the module breakdown logic, go to the homepage.

Abstraction hierarchy

Monoid hierarchy

module Semigroup : sig ... end

A Semigroup is a type t which provides a binary associative operation combine which lets you combine any two values of t into one.

module Monoid : sig ... end

A Monoid is a type t which provides a binary associative operation combine and a neutral element (neutral). In other words, a Monoid is a Semigroup with a neutral element.

Lattice hierarchy

module Meet_semilattice : sig ... end

A Meet_semilattice capture the notion of a set with greatest lower bound. A meet semilattice is an idempotent commutative semigroup.

module Join_semilattice : sig ... end

A Join_semilattice capture the notion of a set with least upper bound. A join semilattice is an idempotent commutative semigroup.

module Bounded_meet_semilattice : sig ... end

A Bounded_meet_semilattice capture the notion of a set with greatest lower bound with a top. A bounded meet semilattice is an idempotent commutative semigroup.

module Bounded_join_semilattice : sig ... end

A Join_semilattice capture the notion of a set with least upper bound with a bottom . A bounded join semilattice is an idempotent commutative semigroup.

module Bounded_lattice : sig ... end

A Bounded_lattice capture the notion of Bounded join semilattice and a Bounded meet semilattice

module Lattice : sig ... end

A Lattice capture the notion of a join semilattice and a meet semilattice

Indexed Functor hierarchy

module Indexed_functor : sig ... end

An Indexed Functor represents a type that can be mapped over (with an index, so an additional type parameter that can be useful for tracking information using row polymorphism). So we can go from ('a, 'index) t to ('b, 'index) t using a function from 'a to 'b. Mapping preserve the structure of the input.

module Indexed_alt : sig ... end

Indexed Alt is an Indexed_functor which is a kind of Semigroup over a parametrized type. In other word, Indexed_alt is a Indexed_functor with a combine operation.

module Indexed_apply : sig ... end

An Indexed Apply is an indexed functor with lifting and sequencing capabilities. Indexed Apply is more general (and by extension weaker) than a Indexed_applicative. An Indexed Apply is also a Indexed_functor.

module Indexed_applicative : sig ... end

An Indexed Applicative is an indexed functor with lifting and sequencing capabilities. Applicative is more general (and by extension weaker) than a Indexed_onad. An Indexed Applicative is also a Indexed_functor.

module Indexed_alternative : sig ... end

Indexed Alternative is a kind of Monoid on Indexed_applicative. An Indexed_alternative is formally an Indexed_pplicative with neutral and combine. So an Indexed_alternative is also an Indexed_applicative (and an Indexed_alt which is also a Indexed_functor).

module Indexed_selective : sig ... end

An Indexed Selective (applicative functor) allows to declare effects statically and select which execute dynamically. It is an algebraic structure between Indexed_applicative and Indexed_monad. An Indexed_selective is also an Indexed_applicative.

module Indexed_bind : sig ... end

An Indexed Bind is an Indexed Monad without return function.

module Indexed_monad : sig ... end

An Indexed Monad allow to sequences operations that are dependent from one to another, in contrast to Indexed_applicative, which executes a series of independent actions.

module Indexed_monad_plus : sig ... end

Indexed Monad_plus is a kind of Monoid on Indexed_monad. A Indexed_monad_plus is formally a Indexed_monad with neutral and combine. So a Indexed_monad_plus is also a Indexed_monad.

module Indexed_comonad : sig ... end

An Indexed Comonad is the dual of the Indexed_monad.

module Indexed_foldable : sig ... end

An Indexed Foldable is a data structure which can be fold. In other word, reduced to a summary value one element at a time

Functor hierarchy

module Invariant : sig ... end

Invariant is an "Invariant Functor". Every Functor and Contravariant is an Invariant Functor.

module Functor : sig ... end

A Functor represents a type that can be mapped over. So we can go from 'a t to 'b t using a function from 'a to 'b. Mapping preserve the structure of the input.

module Alt : sig ... end

Alt is a Functor which is a kind of Semigroup over a parametrized type. In other word, Alt is a Functor with a combine operation.

module Apply : sig ... end

An Apply is a functor with lifting and sequencing capabilities. Apply is more general (and by extension weaker) than a Applicative. An Apply is also a Functor.

module Applicative : sig ... end

An Applicative is a functor with lifting and sequencing capabilities. Applicative is more general (and by extension weaker) than a Monad. An Applicative is also a Functor.

module Alternative : sig ... end

Alternative is a kind of Monoid on Applicative. An Alternative is formally an Applicative with neutral and combine. So an Alternative is also an Applicative (and an Alt which is also a Functor).

module Selective : sig ... end

A Selective (applicative functor) allows to declare effects statically and select which execute dynamically. It is an algebraic structure between Applicative and Monad. A Selective is also an Applicative.

module Bind : sig ... end

A Bind allow to sequences operations that are dependent from one to another, in contrast to Applicative, which executes a series of independent actions. It is a Monad without return operation.

module Monad : sig ... end

A Monad allow to sequences operations that are dependent from one to another, in contrast to Applicative, which executes a series of independent actions.

module Monad_plus : sig ... end

Monad_plus is a kind of Monoid on Monad. A Monad_plus is formally a Monad with neutral and combine. So a Monad_plus is also a Monad.

module Comonad : sig ... end

A Comonad is the dual of the Monad.

module Foldable : sig ... end

A Foldable is a data structure which can be fold. In other word, reduced to a summary value one element at a time

module Traversable : sig ... end

A Traversable is a data structure that can be traversed from left to right, performing an action on each element.

Contravariant functor hierarchy

module Contravariant : sig ... end

Contravariant is a "Contravariant functor". In other word, Contravariant is the dual of a Functor.

module Divisible : sig ... end

Divisible is a "Contravariant Applicative Functor", in other word, Divisible is the dual of an Applicative

module Decidable : sig ... end

Decidable is a "Contravariant Alternative".

Bifunctor hierarchy

module Bifunctor : sig ... end

A Bifunctor is a type constructor that takes two type arguments and is a Functor (Covariant) in both arguments.

Profunctor hierarchy

module Profunctor : sig ... end

A Profunctor is a type constructor that takes two type arguments and is a Contravariant Functor as first argument and a covariant Functor as second argument.

module Strong : sig ... end

Strong is a Profunctor working on product types.

module Choice : sig ... end

Choice is a Profunctor working on sum types (via Either).

module Closed : sig ... end

Closed is a Profunctor working on exponential types (function).

Arrow hierarchy

module Semigroupoid : sig ... end

A Semigroupoid is Category without the identity.

module Category : sig ... end

A Category is a Semigroupoid with an identity at each object.

module Arrow : sig ... end

An Arrow is an abstract view of computation sitting between Applicative and Monad. Arrow is built on the top of Category and Strong. So an Arrow is also a Category.

module Arrow_zero : sig ... end

An Arrow with a neutral element. So Arrow_zero is also an Arrow.

module Arrow_alt : sig ... end

An Arrow with a combine function. So Arrow_alt is also an Arrow. Arrow_alt is a kind of Alt in the arrow hierarchy.

module Arrow_plus : sig ... end

An Arrow_plus is the conjonction of an Arrow_zero and Arrow_alt. An Arrow_plus is a kind of Monoid in the arrow hierarchy. And it also an Arrow_alt and an Arrow_zero (which is also a Arrow).

module Arrow_choice : sig ... end

An Arrow_choice is an Arrow with conditional capabilities. It is a kind of Selective in the arrow hierarchy. And an Arrow_choice is also Arrow.

module Arrow_apply : sig ... end

An Arrow_apply is an Arrow with application capabilities. An Arrow_apply is also Arrow.

Transformers

Monad Transformers

module Reader : sig ... end

A Reader monad parametrized over an inner Monad and an environment. Reader is a monad transformer.

module Writer : sig ... end

A Writer monad parametrized over an inner Monad and an tape which is a Monoid. Writer is a monad transformer.

module State : sig ... end

A State monad parametrized over an inner Monad and a state (which is an arbitrary type). State is a monad transformer.

Comonad Transformers

module Store : sig ... end

A Store comonad parametrized over an inner Comonad and a store (which is an arbitrary type). Store is a comonad transformer. Store is Costate (the dual of State).

module Env : sig ... end

An Env comonad parametrized over an inner Comonad and an env (which is an arbitrary type). Env is a comonad transformer. Env is Coreader (the dual of Reader).

module Traced : sig ... end

A Traced comonad parametrized over an inner Comonad and a tape (which is an arbitrary type). Traced is a comonad transformer. Traced is Cowriter (the dual of Writer).

Free constructions

module Free_applicative : sig ... end

A Free applicative allows you to build an Preface_specs.Applicative from a given Preface_specs.Functor.

module Free_selective : sig ... end

A Free selective allows you to build a rigid Preface_specs.Selective from a given Preface_specs.Functor.

module Freer_selective : sig ... end

A Freer selective allows you to build a rigid Preface_specs.Selective from a given arbitrary type.

module Free_monad : sig ... end

A Free monad allows you to build a Preface_specs.Monad from a given Preface_specs.Functor.

module Freer_monad : sig ... end

A Freer monad allows you to build a Preface_specs.Monad from an arbitrary type (with one type parameter). It offers the same capabilities as a Preface_specs.Free_monad but benefits from a lighter execution cost.

API Shortcuts

As each module exposes all the components of an abstraction, here is a list of shortcuts to directly denote the full API of an abstraction by using its name in upper case.

module type SEMIGROUP = Semigroup.API
module type MONOID = Monoid.API
module type MEET_SEMILATTICE = Meet_semilattice.API
module type JOIN_SEMILATTICE = Join_semilattice.API
module type BOUNDED_MEET_SEMILATTICE = Bounded_meet_semilattice.API
module type BOUNDED_JOIN_SEMILATTICE = Bounded_join_semilattice.API
module type BOUNDED_LATTICE = Bounded_lattice.API
module type LATTICE = Lattice.API
module type INDEXED_FUNCTOR = Indexed_functor.API
module type INDEXED_ALT = Indexed_alt.API
module type INDEXED_APPLY = Indexed_apply.API
module type INDEXED_APPLICATIVE = Indexed_applicative.API
module type INDEXED_ALTERNATIVE = Indexed_alternative.API
module type INDEXED_SELECTIVE = Indexed_selective.API
module type INDEXED_BIND = Indexed_bind.API
module type INDEXED_MONAD = Indexed_monad.API
module type INDEXED_MONAD_PLUS = Indexed_monad_plus.API
module type INDEXED_COMONAD = Indexed_comonad.API
module type INDEXED_FOLDABLE = Indexed_foldable.API
module type FUNCTOR = Functor.API
module type BIFUNCTOR = Bifunctor.API
module type PROFUNCTOR = Profunctor.API
module type STRONG = Strong.API
module type CHOICE = Choice.API
module type CLOSED = Closed.API
module type APPLY = Apply.API
module type APPLICATIVE = Applicative.API
module type ALT = Alt.API
module type ALTERNATIVE = Alternative.API
module type SELECTIVE = Selective.API
module type BIND = Bind.API
module type MONAD = Monad.API
module type MONAD_PLUS = Monad_plus.API
module type COMONAD = Comonad.API
module type FOLDABLE = Foldable.API
module type TRAVERSABLE = Traversable.API
module type FREE_APPLICATIVE = Free_applicative.API
module type FREE_SELECTIVE = Free_selective.API
module type FREER_SELECTIVE = Freer_selective.API
module type FREE_MONAD = Free_monad.API
module type FREER_MONAD = Freer_monad.API
module type INVARIANT = Invariant.API
module type CONTRAVARIANT = Contravariant.API
module type DIVISIBLE = Divisible.API
module type SEMIGROUPOID = Semigroupoid.API
module type DECIDABLE = Decidable.API
module type CATEGORY = Category.API
module type ARROW = Arrow.API
module type ARROW_ZERO = Arrow_zero.API
module type ARROW_ALT = Arrow_alt.API
module type ARROW_PLUS = Arrow_plus.API
module type ARROW_CHOICE = Arrow_choice.API
module type ARROW_APPLY = Arrow_apply.API
module type READER = Reader.API
module type WRITER = Writer.API
module type STATE = State.API
module type STORE = Store.API
module type ENV = Env.API
module type TRACED = Traced.API

Types

Sometimes, in order to construct an abstraction, it is only necessary to give it a type (For example, Freer_monad).

module Types : sig ... end

Signatures representing types. Mainly used as a functor parameter