Preface_specs.BindA 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.
To have a predictable behaviour, the instance of Bind must obey some laws.
(m >>= f) >>= g = m >>= (fun x +> f x >>= g)join % join = join % (map join)map id = idmap (g % f) = map g % map fmap f % join = join % map (map f)map f % pure = pure % f(f >=> g) >=> h = f >=> (g >=> h)module type WITH_BIND = sig ... endMinimal definition using bind.
module type WITH_MAP_AND_JOIN = sig ... endMinimal definition using map and join.
module type WITH_KLEISLI_COMPOSITION = sig ... endMinimal definition using compose_left_to_right.
module type WITH_MAP_AND_BIND = sig ... endMinimal definition using map and bind.
module type WITH_MAP_AND_KLEISLI_COMPOSITION = sig ... endMinimal definition using map and compose_left_to_right.
module type CORE = sig ... endBasis operations.
module type OPERATION = sig ... endAdditional operations.
module type SYNTAX = sig ... endSyntax extensions.
module type INFIX = sig ... endInfix operators.
module type API = sig ... endThe complete interface of a Bind.