package stdune

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module type Basic = sig ... end
module type S = sig ... end
module Make (M : Basic) : S with type t := M.t

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

module Exists : S with type t = bool

The monoid you get with empty = false and combine = ( || ).

module Forall : S with type t = bool

The monoid you get with empty = true and combine = ( && ).

module String : S with type t = string

The string concatenation monoid with empty = "" and combine = ( ^ ).

module List (M : sig ... end) : S with type t = M.t list

The list monoid with empty = [] and combine = ( @ ).

module Appendable_list (M : sig ... end) : S with type t = M.t Appendable_list.t

The list monoid with empty = [] and combine = ( @ ).

module Unit : S with type t = Unit.t

The trivial monoid with empty = () and combine () () = ().

module Add (M : sig ... end) : S with type t = M.t

The addition monoid with empty = zero and combine = ( + ).

module Mul (M : sig ... end) : S with type t = M.t

The multiplication monoid with empty = one and combine = ( * ).

module Union (M : sig ... end) : S with type t = M.t

The union monoid with empty = M.empty and combine = M.union.

module Product (A : sig ... end) (B : sig ... end) : S with type t = A.t * B.t

The product of monoids where pairs are combined component-wise.

module Product3 (A : sig ... end) (B : sig ... end) (C : sig ... end) : S with type t = A.t * B.t * C.t

Same as Product but for 3 monoids.

module Function (A : sig ... end) (M : sig ... end) : S with type t = A.t -> M.t

Functions that return a monoid form the following monoid:

module Endofunction : sig ... end

Endofunctions, i.e., functions of type t -> t, form two monoids.

OCaml

Innovation. Community. Security.