alice
library
manual.

Alice Project

The CHAR signature


________ Synopsis ____________________________________________________

    signature CHAR
    structure Char : CHAR where type char = char and type string = string
  

An extended version of the Standard ML Basis' CHAR signature.

See also: String, HASHABLE, ORDERED


________ Import ______________________________________________________

Imported implicitly.


________ Interface ___________________________________________________

    signature CHAR =
    sig
	eqtype char
	eqtype string
	type t = char

	val minChar :     char
	val maxChar :     char
	val maxOrd :      int

	val chr :         int -> char
	val ord :         char -> int
	val pred :        char -> char
	val succ :        char -> char

	val op < :        char * char -> bool
	val op <= :       char * char -> bool
	val op > :        char * char -> bool
	val op >= :       char * char -> bool
	val equal :       char * char -> bool
	val compare :     char * char -> order
	val hash :        char -> int

	val contains :    string -> char -> bool
	val notContains : string -> char -> bool

	val toLower :     char -> char
	val toUpper :     char -> char

	val isLower :     char -> bool
	val isUpper :     char -> bool
	val isAlpha :     char -> bool
	val isAlphaNum :  char -> bool
	val isDigit :     char -> bool
	val isBinDigit :  char -> bool
	val isOctDigit :  char -> bool
	val isHexDigit :  char -> bool
	val isPunct :     char -> bool
	val isPrint :     char -> bool
	val isGraph :     char -> bool
	val isSpace :     char -> bool
	val isCntrl :     char -> bool
	val isAscii :     char -> bool

	val toString :    char -> string
	val toCString :   char -> string
	val fromString :  string -> char option
	val fromCString : string -> char option
	val scan :        (char,'a) StringCvt.reader -> (char,'a) StringCvt.reader
	val scanC :       (char,'a) StringCvt.reader -> (char,'a) StringCvt.reader
    end
  

________ Description _________________________________________________

Items not described here are as in the Standard ML Basis' CHAR signature.

type t = char

A local synonym for type char.

equal (c1, c2)

An explicit equality function on chars. Equivalent to op=.

hash c

A hash function for characters. Returns Int.hash (ord c).

isBinDigit c

Returns true iff c is a binary digit (0 or 1).

isOctDigit c

Returns true iff c is an octal digit (0-7).

scanC getc strm

Scans a character (including space) or a C escape sequence representing a character from the prefix of a string. Similar to scan, except that it uses C escape conventions, like the function fromCString.



last modified 2007/Mar/30 17:10