Preface_specs.Functor
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.
To have a predictable behaviour, the instance of Functor
must obey some laws.
map id = id
;map (f % g) = map f % map g
.module type WITH_MAP = sig ... end
The minimum definition of a Functor
. It is by using the combinators of this module that the other combinators will be derived.
module type CORE = WITH_MAP
Basis operations.
module type OPERATION = sig ... end
Additional operations.
module type INFIX = sig ... end
Infix operators.
module type SYNTAX = sig ... end
Syntax operators.
module type API = sig ... end
The complete interface of a Functor
.