Module Ord.Reverse

Functor building an implementation of ORD whose ordering is the reverse of the given totally ordered type.

Parameters

module Ord : ORD

Signature

type t = Ord.t

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).