Library
Module
Module type
Parameter
Class
Class type
This module exposes a type 'a t
. A value of type a t
is used for comparing and pretty printing values of type a
.
val make : ('a -> 'a -> int) -> (Format.formatter -> 'a -> unit) -> 'a t
make compare pp
constructs a comparator using the given compare
to compare value and pp
to print them.
val compare : 'a t -> 'a -> 'a -> int
compare c x y
compares x
and y
using the c
comparator.
val pp : 'a t -> Format.formatter -> 'a -> unit
pp c x
prints x
using the c
comparator.
val int : int t
int
is an integer comparator.
val float : float t
float
is a float comparator.
val bool : bool t
bool
is a bool comparator.
val string : string t
string
is a string comparator.
tuple c1 c2
creates a comparator for tuples using the comparators c1
and c2
.
option c
creates a comparator for options using the the comparator c
.