Module Preface_specs.Invariant

Invariant is an "Invariant Functor". Every Functor and Contravariant is an Invariant Functor.

Laws

To have a predictable behaviour, the instance of Invariant must obey some laws.

  1. invmap id id = id
  2. invmap f2 f2' % invmap f1 f1' = invmap (f2 % f1) (f1' % f2')

Minimal definition

module type WITH_INVMAP = sig ... end

Structure anatomy

module type CORE = WITH_INVMAP

Complete API

module type API = CORE

The complete interface of an Invariant.

Additional references