Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
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:
a < b
and b < c
imples a < c
. The same holds of equality and >
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) ->
'a ->
'b ->
Ordering.t option
Compares values x
and y
with module M
and returns an ordering if one exists