Module Cduce_types__CharSet.V

A module for manipulating atom Values.

The type of characters operations.

include Custom.T
type t
val dump : Stdlib.Format.formatter -> t -> unit
val check : t -> unit
val equal : t -> t -> bool
val hash : t -> int
val compare : t -> t -> int
val mk_int : int -> t

mk_int i creates a character from it Unicode code point.

raises [Failure]

if i is not a valid code point.

val mk_char : char -> t

mk_char c creates a character from an OCaml char, that is a code point in the range [0-255].

val to_int : t -> int

to_int t returns the integer corresponding to the code point.

val to_char : t -> char

to_char t returns the char corresponding to the code point.

raises [Failure]

if t is not in the range [0-255].

val print : Stdlib.Format.formatter -> t -> unit

print_in_string fmt t prints the code point correctly escaped, between a pair of single quotes. Code points 9 (horizontal tab), 10 (new line), 13 (carriage return), 34 (double quote) 39 (single quote) are printed as '\t', '\n', '\r', '\"' and '\'' repsectively.

Code points below 32 (non printable characters) or above 127 (non ascii characters) are printed as their ℂDuce escape sequence \ddddd.

val print_in_string : Stdlib.Format.formatter -> t -> unit

print_in_string fmt t prints the code point as print but without the surrounding single quotes.