Prelude.CharsAdditional 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 : sig ... endmodule Lowercase : sig ... endmodule Alphabetic : sig ... endmodule Decimal : sig ... endmodule Octal : sig ... endmodule Hex : sig ... end(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 : sig ... end