alg_structs

Interfaces and module combinators for algebraic structures
IN THIS PACKAGE
module Make (T : Triv.S) : S with type t = T.t -> T.t

Make (T) is a module implementing the Endo semigroup for functions over type T.t

val make : 'a Alg_structs__Util.proxy -> (module S with type t = 'a -> 'a)

make (Proxy : t Util.proxy) is a first-class module implementing the Endo semigroup for functions (t -> t).

Note that Proxy is used only to convey the type. See Util.proxy.

You can lift the result back into the module like so:

# module E = (val Semigroup.Endo.make (Util.Proxy : int proxy));;
module E :
sig
  type t = int -> int
  val op : t -> t -> t
  val ( * ) : t -> t -> t
  val concat : t NonEmptyList.t -> t
end