Module type Utils.Comparable
Interface for comparable and hashable types. Modules implementing this interface can be an argument of Map.Make
, Set.Make
or Hashtbl.Make
.
- since
- 2.0
val compare : t -> t -> int
Comparison over
t
.compare x y
returns0
iffequal x y = 0
. Ifx
andy
are not equal, it returns a negative integer iffx
is lesser thany
and a positive integer otherwise.
val hash : t -> int
A hash function over
t
.