package stdune

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

This functor extends the basic definition of a commutative monoid by adding a convenient operator synonym ( @ ) = combine, as well as derived functions reduce and map_reduce.

Parameters

module M : Basic

Signature

val empty : M.t

Must be the identity of combine:

  • combine empty t = t
  • combine t empty = t
val combine : M.t -> M.t -> M.t

Must be associative:

  • combine a (combine b c) = combine (combine a b) c
module O : sig ... end
val reduce : M.t list -> M.t
val map_reduce : f:('a -> M.t) -> 'a list -> M.t
type combine_is_commutative = unit
OCaml

Innovation. Community. Security.