package uucp

  1. Overview
  2. Docs

Characters.

Characters

type t = uchar

The type for characters. See uchar.

val min : uchar

min is U+0000.

val max : uchar

max is U+10FFFF.

val is_uchar : int -> bool

is_uchar n is true iff n is an Unicode scalar value.

val succ : uchar -> uchar

succ u is the scalar value after u in the set of Unicode scalar values.

  • raises Invalid_argument

    if u is max.

val pred : uchar -> uchar

pred u is the scalar value before u in the set of Unicode scalar values.

  • raises Invalid_argument

    if u is min.

val of_int : int -> uchar

of_int i is i as an uchar.

  • raises Invalid_argument

    if i does not satisfy is_uchar.

val to_int : uchar -> int

to_int u is the scalar value of u as an integer.

val equal : uchar -> uchar -> bool

equal u u' is u = u').

val compare : uchar -> uchar -> int

compare u u' is Pervasives.compare u u'.

Full Unicode character set traversal

val fold : ('a -> uchar -> 'a) -> 'a -> 'a

fold f acc is (f (…(f (f (…(f (f acc 0x0000) 0x0001…) 0xD7FF) 0xE000)…) 0x10FFFF)

val iter : (uchar -> unit) -> unit

iter f is f 0x0000; f0x0001; …; f 0xD7FF; f 0xE000; …; f 0x10FFFF

Printers

val pp : Format.formatter -> uchar -> unit

pp ppf u prints u on ppf using only US-ASCII encoded characters according to the Unicode notational convention.

OCaml

Innovation. Community. Security.