Preface_specs.Divisible
Divisible
is a "Contravariant Applicative Functor", in other word, Divisible
is the dual of an Applicative
To have a predictable behaviour, the instance of Divisible
must obey some laws.
Contravariant
lawsdivide f x conquer = contramap (Stdlib.fst % f) x
divide f conquer x = contramap (Stdlib.snd % f) x
divide f (divide g m n) o
= divide
(fun x ->
let bc, _ = f x in
let b, c = g bc in
(a, (b, c)) )
m (divide id n o)
module type WITH_DIVIDE_AND_CONQUER = sig ... end
Exposes the divide
and conquer
functions, mandatory for each requirement.
module type WITH_CONTRAMAP_AND_DIVIDE_AND_CONQUER = sig ... end
module type CORE = WITH_CONTRAMAP_AND_DIVIDE_AND_CONQUER
Basis operations.
module type OPERATION = sig ... end
Additional operations.
module type INFIX = sig ... end
Infix operators.
module type API = sig ... end
The complete interface of a Divisible
.