package lsp

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

Module Stdune.MonoidSource

Sourcemodule type Basic = sig ... end
Sourcemodule type S = sig ... end
Sourcemodule 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.

Sourcemodule Exists : S with type t = bool

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

Sourcemodule Forall : S with type t = bool

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

Sourcemodule String : S with type t = string

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

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

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

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

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

Sourcemodule Unit : S with type t = Unit.t

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

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

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

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

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

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

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

Sourcemodule 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.

Sourcemodule 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.

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

Functions that return a monoid form the following monoid:

Sourcemodule Endofunction : sig ... end

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

OCaml

Innovation. Community. Security.