Module Base__.Uchar
type t
= Base__.Uchar0.t
val compare : t -> t -> int
val hash_fold_t : Base.Hash.state -> t -> Base.Hash.state
val hash : t -> Base.Hash.hash_value
include Base.Sexpable.S with type t := t
val t_of_sexp : Base.Sexp.t -> t
val sexp_of_t : t -> Base.Sexp.t
include Base.Comparable.S with type t := t
include Base__.Comparable_intf.Polymorphic_compare
val ascending : t -> t -> int
ascending
is identical tocompare
.descending x y = ascending y x
. These are intended to be mnemonic when used likeList.sort ~compare:ascending
andList.sort ~cmp:descending
, since they cause the list to be sorted in ascending or descending order, respectively.
val descending : t -> t -> int
val between : t -> low:t -> high:t -> bool
between t ~low ~high
meanslow <= t <= high
val clamp_exn : t -> min:t -> max:t -> t
clamp_exn t ~min ~max
returnst'
, the closest value tot
such thatbetween t' ~low:min ~high:max
is true.Raises if
not (min <= max)
.
val clamp : t -> min:t -> max:t -> t Base.Or_error.t
include Base.Comparator.S with type t := t
val comparator : (t, comparator_witness) Base.Comparator.comparator
include Base__.Comparable_intf.Validate with type t := t
val validate_lbound : min:t Base.Maybe_bound.t -> t Base.Validate.check
val validate_ubound : max:t Base.Maybe_bound.t -> t Base.Validate.check
val validate_bound : min:t Base.Maybe_bound.t -> max:t Base.Maybe_bound.t -> t Base.Validate.check
val succ : t -> t option
succ_exn t
is the scalar value aftert
in the set of Unicode scalar values, and raises ift = max_value
.
val succ_exn : t -> t
val pred : t -> t option
pred_exn t
is the scalar value beforet
in the set of Unicode scalar values, and raises ift = min_value
.
val pred_exn : t -> t
val is_char : t -> bool
is_char t
istrue
iffn
is in the latin-1 character set.
val to_char : t -> char option
to_char_exn t
ist
as achar
if it is in the latin-1 character set, and raises otherwise.
val int_is_scalar : int -> bool
int_is_scalar n
istrue
iffn
is an Unicode scalar value (i.e., in the ranges0x0000
...0xD7FF
or0xE000
...0x10FFFF
).
val of_scalar : int -> t option
of_scalar_exn n
isn
as a Unicode character. Raises ifnot (int_is_scalar i)
.