package traits

  1. Overview
  2. Docs

PartialOrd defines primitives for partial order over two types (t and rhs)

In order for a module to implement PartialOrd, it has to conform to the T signature, which implies conformance to PartialEq.T

The comparison must satisfy the following conditions:

  1. Transitivity: a < b and b < c imples a < c. The same holds of equality and >
  2. Duality: a < b if and only if b > a
module type Trait = sig ... end

PartialOrd implementation signature

module type T = sig ... end

Signature that defines PartialOrd conformity

val partial_cmp : (module T with type PartialOrd.rhs = 'b and type PartialOrd.t = 'a) -> 'a0 -> 'b0 -> Ordering.t option

Compares values x and y with module M and returns an ordering if one exists