Preface_specsSet of interfaces describing all the abstractions available in Preface. For a detailed description of the module breakdown logic, go to the homepage.
module Semigroup : sig ... endA 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 ... endA 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.
module Invariant : sig ... endInvariant is and "Invariant Functor". Every Functor and Contravariant is an Invariant Functor.
module Functor : sig ... endA 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 ... endmodule Apply : sig ... endAn 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 ... endmodule Alternative : sig ... endAlternative 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 ... endA 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 ... endA 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 : sig ... endA 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 ... endmodule Foldable : sig ... endA 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 ... endA Traversable is a data structure that can be traversed from left to right, performing an action on each element.
module Contravariant : sig ... endContravariant is a "Contravariant functor". In other word, Contravariant is the dual of a Functor.
module Divisible : sig ... endDivisible is a "Contravariant Applicative Functor", in other word, Divisible is the dual of an Applicative
module Decidable : sig ... endDecidable is a "Contravariant Alternative".
module Bifunctor : sig ... endA Bifunctor is a type constructor that takes two type arguments and is a Functor (Covariant) in both arguments.
module Profunctor : sig ... endA 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 ... endStrong is a Profunctor working on product types.
module Choice : sig ... endChoice is a Profunctor working on sum types (via Either).
module Closed : sig ... endClosed is a Profunctor working on exponential types (function).
module Semigroupoid : sig ... endA Semigroupoid is Category without the identity.
module Category : sig ... endA Category is a Semigroupoid with an identity at each object.
module Arrow : sig ... endAn 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 ... endmodule Arrow_alt : sig ... endmodule Arrow_plus : sig ... endAn 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 ... endmodule Arrow_apply : sig ... endmodule Reader : sig ... endA Reader monad parametrized over an inner Monad and an environment. Reader is a monad transformer.
module Writer : sig ... endmodule State : sig ... endA State monad parametrized over an inner Monad and a state (which is an arbitrary type). State is a monad transformer.
module Store : sig ... endA 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 ... endAn 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 ... endA 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).
module Free_applicative : sig ... endA Free applicative allows you to build an Preface_specs.Applicative from a given Preface_specs.Functor.
module Free_selective : sig ... endA Free selective allows you to build a rigid Preface_specs.Selective from a given Preface_specs.Functor.
module Freer_selective : sig ... endA Freer selective allows you to build a rigid Preface_specs.Selective from a given arbitrary type.
module Free_monad : sig ... endA Free monad allows you to build a Preface_specs.Monad from a given Preface_specs.Functor.
module Freer_monad : sig ... endA 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.
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.APImodule type MONOID = Monoid.APImodule type FUNCTOR = Functor.APImodule type BIFUNCTOR = Bifunctor.APImodule type PROFUNCTOR = Profunctor.APImodule type STRONG = Strong.APImodule type CHOICE = Choice.APImodule type CLOSED = Closed.APImodule type APPLY = Apply.APImodule type APPLICATIVE = Applicative.APImodule type ALT = Alt.APImodule type ALTERNATIVE = Alternative.APImodule type SELECTIVE = Selective.APImodule type BIND = Bind.APImodule type MONAD = Monad.APImodule type MONAD_PLUS = Monad_plus.APImodule type COMONAD = Comonad.APImodule type FOLDABLE = Foldable.APImodule type TRAVERSABLE = Traversable.APImodule type FREE_APPLICATIVE = Free_applicative.APImodule type FREE_SELECTIVE = Free_selective.APImodule type FREER_SELECTIVE = Freer_selective.APImodule type FREE_MONAD = Free_monad.APImodule type FREER_MONAD = Freer_monad.APImodule type INVARIANT = Invariant.APImodule type CONTRAVARIANT = Contravariant.APImodule type DIVISIBLE = Divisible.APImodule type SEMIGROUPOID = Semigroupoid.APImodule type DECIDABLE = Decidable.APImodule type CATEGORY = Category.APImodule type ARROW = Arrow.APImodule type ARROW_ZERO = Arrow_zero.APImodule type ARROW_ALT = Arrow_alt.APImodule type ARROW_PLUS = Arrow_plus.APImodule type ARROW_CHOICE = Arrow_choice.APImodule type ARROW_APPLY = Arrow_apply.APImodule type READER = Reader.APImodule type WRITER = Writer.APImodule type STATE = State.APImodule type STORE = Store.APImodule type ENV = Env.APImodule type TRACED = Traced.APISometimes, in order to construct an abstraction, it is only necessary to give it a type (For example, Freer_monad).
module Types : sig ... endSignatures representing types. Mainly used as a functor parameter