Legend:
Library
Module
Module type
Parameter
Class
Class type
The main groups of signatures provided by this module are:
Basicn: minimal definition of new modules without an existing Container instance;
Basicn _container: minimal definition of new modules with an existing Container instance;
Sn: full traversable containers, produced by applying functors to either of the two groups.
We also define other signatures, mostly for internal book-keeping. They may be useful elsewhere, however.
Inner-traversal signatures
These signatures form the inner body of the On_monad functor in the main signatures. They all have names ending with _on_monad, and assume the existence of a monad M.
While they aren't interesting on their own, they do contain (in slightly abstract form) the specific functions needed to build, and provided on building, traversable containers.
The generic signatures
As with Mappable, we define some signatures for traversable structures in an arity-generic way, then specialise them for arity-0 and arity-1 types.
S1_on_monad extends Generic_on_monad with functionality that only works on arity-1 containers.
Basic signatures
Any traversable type can be turned into a Core container, using the monadic fold to implement all container functionality. The unified signature of a container with monadic traversals is S0 (arity 0) or S1 (arity 1).
To satisfy these signatures for new types, implement Basic0 or Basic1, and use the corresponding MakeN functor.
For types that are _already_ Core containers, or types where custom implementation of the Core signature are desired, implement Basic0_container or Basic1_container, and use the MakeN_container functors.