package mugen

  1. Overview
  2. Docs

Infinite products with finite elements different from a fixed displacement.

Parameters

module Base : S

Signature

include S
include StructuredType.PartiallyOrderedType
include StructuredType.EqualityType
type t

The type.

val equal : t -> t -> bool

equal x y checks whether x and y are equivalent.

val dump : Format.formatter -> t -> unit

Ugly printer.

val lt : t -> t -> bool

lt x y checks if x is strictly less than y. Note that trichotomy fails for general partial orders.

val leq : t -> t -> bool

leq x y checks if x is less than or equal to y. Note that trichotomy fails for general partial orders.

val id : t

id is the unit.

val is_id : t -> bool

is_id s checks whether s is the unit. It is equivalent to equal id s, but potentially faster.

val compose : t -> t -> t

compose s1 s2 composes the operators s1 and s2. Note that Foo^s1^s2 in McBride's notation is understood as compose (compose ... s2) s1 with the reversed order.

val of_based_list : (Base.t * Base.t list) -> t

Conversion from a based list; a based list (b, l) represents the following infinite product (as a function from natural numbers to Base.t)

f 0 = List.nth l 0
f 1 = List.nth l 1
...
f (n-1) = List.nth l (n-1)
f n = b
f (n+1) = b
...
val to_based_list : t -> Base.t * Base.t list

Right inverse of of_based_list. It is not a left inverse of of_based_list because trailing values that are equal to the base will be stripped.

OCaml

Innovation. Community. Security.