package travesty

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

Signatures for (non-monadic) bi-mapping.

The main signatures are S2, S1_left, S1_right, and S0 We also define various extension signatures.

The generic signature

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

module type Generic = sig ... end

Generic describes bi-mapping on any arity of type.

Basic signatures

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

module type S0 = sig ... end

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

module type S1_left = sig ... end

S1_left is the 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 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 signature of an arity-2 bi-mappable type with floating left and right types.

Extensions

The signatures below describe various functions we can derive from bi-mappable types and mappable containers. To apply them to existing types, use the functors in Bi_mappable.

module type Generic_extensions = sig ... end

Generic_extensions describes extensions that apply to all arities, in an arity-neutral manner.

module type Extensions0 = sig ... end

Extensions for arity-0 bi-mappable containers.

module type S0_with_extensions = sig ... end

Combines S0 and Extensions0.

module type Extensions1_left = sig ... end

Extensions for arity-1 bi-mappable containers with a floating left type.

module type S1_left_with_extensions = sig ... end
module type Extensions1_right = sig ... end

Extensions for arity-1 bi-mappable containers with a floating right type.

module type S1_right_with_extensions = sig ... end
module type Extensions2 = sig ... end

Extensions2 describes various extensions of arity-1 mappable containers.

module type S2_with_extensions = sig ... end

Combines S2 and Extensions2.

OCaml

Innovation. Community. Security.