1 (* Copyright (C
) 1999-2007 Henry Cejtin
, Matthew Fluet
, Suresh
2 * Jagannathan
, and Stephen Weeks
.
4 * MLton is released under a BSD
-style license
.
5 * See the file MLton
-LICENSE for details
.
8 functor IntegralComparisons (type t
9 val < : t
* t
-> bool) =
11 val < : t
* t
-> bool = <
12 fun <= (a
, b
) = not (< (b
, a
))
13 fun > (a
, b
) = < (b
, a
)
14 fun >= (a
, b
) = <= (b
, a
)
18 else if < (j
, i
) then GREATER
20 fun min (x
, y
) = if < (x
, y
) then x
else y
21 fun max (x
, y
) = if < (x
, y
) then y
else x
23 functor UnsignedIntegralComparisons (type int
25 val idFromIntToWord
: int -> word
26 val < : word * word -> bool) =
29 fun ltu (i
: int, i
': int) = < (idFromIntToWord i
, idFromIntToWord i
')
30 structure S
= IntegralComparisons (type t
= int