package travesty

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

The main groups of signatures provided by this module are:

  • Basicn: minimal definition of bi-mappable modules;
  • Sn: full bi-mappable containers, produced by applying functors to the above.

We also define other signatures, mostly for internal book-keeping. They may be useful elsewhere, however.

Basic signatures

The generic signature

As with Traversable, we define the basic signature of bi-mappable structures in an arity-generic way, then specialise it for the various arities.

module type Basic_generic = sig ... end

Basic_generic describes bi-mapping on any arity of type.

Arity-specific basic signatures

The basic signatures are Basic0, which defines mapping across an arity-0 type t (with a fixed, associated element type elt); Basic1_left and Basic1_right, which fix the right and left element type respectively (leaving the named type floating); and Basic2, which defines mapping across an arity-2 type ('l, 'r) t with left element type 'l and right element type 'r.

module type Basic0 = sig ... end

Basic0 is the basic signature of an arity-0 bi-mappable type.

module type Basic1_left = sig ... end

Basic1_left is the basic signature of an arity-1 bi-mappable type with a floating left type and fixed right type.

module type Basic1_right = sig ... end

Basic1_right is the signature of an arity-1 bi-mappable type with a floating right type and fixed left type.

module type Basic2 = sig ... end

Basic2 is the signature of an arity-2 bi-mappable type with floating left and right types.

Signatures for bi-mappable types

The signatures below include various functions we can derive from bi-mappable types.

module type Generic = sig ... end

Generic is a generic interface for bi-mappable types, used to build S0 (arity-0) and S1 (arity-1).

module type S0 = sig ... end

S0 is the full signature of an arity-0 bi-mappable type.

module type S1_left = sig ... end

S1_left is the full signature of an arity-1 bi-mappable type with a floating left type and fixed right type.

module type S1_right = sig ... end

S1_right is the full signature of an arity-1 bi-mappable type with a floating right type and fixed left type.

module type S2 = sig ... end

S2 is the full signature of an arity-2 bi-mappable type with floating left and right types.

OCaml

Innovation. Community. Security.