Legend:
Library
Module
Module type
Parameter
Class
Class type
Signatures for (non-monadic) mapping.
The main signatures are S0 and S1. We also define container forms of the above, which include the Core container interfaces, and Extensions1, a signature of extensions to arity-1 mappable containers.
The generic signature
As with Traversable, we define the signature of mappable structures in an arity-generic way, then specialise it for arity-0 and arity-1 types.
Generic describes mapping on either an arity-0 or arity-1 type.
Basic signatures
The basic signatures are S0, which defines mapping across an arity-0 type t (with a fixed, associated element type elt), and S1, which defines mapping across an arity-1 type 'a t (with element type 'a).
Unlike with Traversable's map_m, we can't actually implement the Core container signatures over map alone. We still define versions of the Mappable interfaces that include their respective container signatures, both for symmetry and to allow for extensions.
S1_container is the signature of an arity-1 mappable container.
Extensions
The signatures below describe various functions we can derive from mappable types and mappable containers. To apply them to existing types, use the functors in Mappable.