small change in CCOrd

This commit is contained in:
Simon Cruanes 2014-06-14 02:16:14 +02:00
parent e3bde40598
commit 2492ee48a6
2 changed files with 13 additions and 0 deletions

View file

@ -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

View file

@ -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