Module Char

Character operations and character classes.

type Char.Class = either {
  .any!,
  .ascii either {
    .alpha!,
    .alphanum!,
    .any!,
    .digit!,
  },
  .char Char,
  .whitespace!,
}

A class of characters for parsers and Char.Is.

  • .any! — any character.
  • .char c — a specific character.
  • .whitespace! — any whitespace character.
  • .ascii.any! — any ASCII character.
  • .ascii.alpha! — ASCII letter (a-z, A-Z).
  • .ascii.alphanum! — ASCII letter or digit.
  • .ascii.digit! — ASCII digit (0-9).
dec Char.Code : [Char] Nat

Returns the Unicode code point of a character as a natural number.

dec Char.FromCode : [Nat] Char

Converts a Unicode code point to a character. Invalid code points become the Unicode replacement character.