Prelude.CharThis is Ocaml's standard Char with the additional functions from Chars.
include module type of struct include Stdlib.Char endinclude module type of struct include Chars endAdditional char functions.
N.B. These functions pertain only to chars as ASCII bytes.
to_int is Char.code.
of_int is Char.chr.
(upto a b) is the list of the chars between a and b inclusive; not tail-recursive.
(upto '0' '9') = ['0';'1';'2';'3';'4';'5';'6';'7';'8';'9'](--) is upto.
module Uppercase = Chars.Uppercasemodule Lowercase = Chars.Lowercasemodule Alphabetic = Chars.Alphabeticmodule Decimal = Chars.Decimalmodule Octal = Chars.Octalmodule Hex = Chars.Hex(to_string c) is the string containing just the character c.
Invariants:
String.len (to_string c) = 1String.get (to_string c) 0 = c(random ?(printable=true) ?charset ()) is a random printable ASCII character in the range [0x20 -- 0x7E].
If (printable = false), the result is a random ASCII character in the range [0x00 -- 0x7E].
If charset is provided, it trumps printable and the characters will be chosen from this list.
Partially apply for efficiency.
module Ops = Chars.Ops