= 768" x-on:close-sidebar="sidebar=window.innerWidth >= 768 && true">
On This Page
package containers
-
containers
-
containers.data
-
containers.monomorphic
-
containers.sexp
-
containers.top
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Comparisons
val compare : 'a t
Polymorphic "magic" comparison.
val int : int t
val string : string t
val bool : bool t
val float : float t
Lexicographic Combination
val (<?>) : int -> ('a t * 'a * 'a) -> int
c1 <?> (ord, x, y)
returns the same as c1
if c1
is not 0
; otherwise it uses ord
to compare the two values x
and y
, of type 'a
.
Example:
CCInt.compare 1 3
<?> (String.compare, "a", "b")
<?> (CCBool.compare, true, false)
Same example, using only CCOrd::
CCOrd.(int 1 3
<?> (string, "a", "b")
<?> (bool, true, false))
Comparison of optional values. None
is smaller than any Some _
.
- since 0.15
map f ord
is the comparison function that, given objects x
and y
, projects x
and y
using f
(e.g. using a record field) and then compares those projections with ord
. Example: map fst CCInt.compare
compares values of type (int * 'a)
by their first component.
module Infix : sig ... end
On This Page