mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-07 03:35:30 -05:00
small change in CCOrd
This commit is contained in:
parent
e3bde40598
commit
2492ee48a6
2 changed files with 13 additions and 0 deletions
|
|
@ -31,6 +31,13 @@ type 'a t = 'a -> 'a -> int
|
|||
|
||||
let compare = Pervasives.compare
|
||||
|
||||
let opp f x y = - (f x y)
|
||||
|
||||
let equiv i j =
|
||||
if i<0 then j<0
|
||||
else if i>0 then j>0
|
||||
else j=0
|
||||
|
||||
let int_ (x:int) y = Pervasives.compare x y
|
||||
let string_ (x:string) y = Pervasives.compare x y
|
||||
let bool_ (x:bool) y = Pervasives.compare x y
|
||||
|
|
|
|||
|
|
@ -32,6 +32,12 @@ type 'a t = 'a -> 'a -> int
|
|||
val compare : 'a t
|
||||
(** Polymorphic "magic" comparison *)
|
||||
|
||||
val opp : 'a t -> 'a t
|
||||
(** Opposite order *)
|
||||
|
||||
val equiv : int -> int -> bool
|
||||
(** Returns [true] iff the two comparison results are the same *)
|
||||
|
||||
val int_ : int t
|
||||
val string_ : string t
|
||||
val bool_ : bool t
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue