Preface_specs.Invariant
Invariant
is an "Invariant Functor". Every Functor
and Contravariant
is an Invariant Functor.
To have a predictable behaviour, the instance of Invariant
must obey some laws.
invmap id id = id
invmap f2 f2' % invmap f1 f1' = invmap (f2 % f1) (f1' % f2')
module type WITH_INVMAP = sig ... end
module type CORE = WITH_INVMAP
module type API = CORE
The complete interface of an Invariant
.