Module Fold_map

module Fold_map: Fold_map

module type Foldable = sig .. end
Input signature of the functor Fold_map.Make
module type S = sig .. end
Output signature of the functor Fold_map.Make
module Make: 
functor (Fold : Foldable) -> S with type in_value = Fold.data and type out_value = Fold.t
Builds a fold_map

Sexpable interface
Same as above but builds the sexp_of and of_sexp functions. Requires the passed in types to be sexpable.
module type S_sexpable = sig .. end
module type Foldable_sexpable = sig .. end
module Make_sexpable: 
functor (Fold : Foldable_sexpable) -> S_sexpable with type in_value = Fold.data and type out_value = Fold.t

Polymorphic folds

Polymorphic fold take a

module type Foldable2 = sig .. end
module type S2 = sig .. end
module Make2: 
functor (Fold : Foldable2) -> S2 with type 'a out_value = 'a Fold.t

Sexpable interface

module type Foldable2_sexpable = sig .. end
module type S2_sexpable = sig .. end
module Make2_sexpable: 
functor (Fold : Foldable2_sexpable) -> S2_sexpable with type 'a out_value = 'a Fold.t

Predefined modules


module Cons: S2_sexpable 
  with type 'a out_value = 'a list
module Add: S_sexpable 
  with type in_value  = int
  and  type out_value = int
A fold for adding.
module Multiply: S_sexpable 
  with type in_value  = int
  and  type out_value = int