signature UNIQUE_STRING structure UniqueString : UNIQUE_STRING where String = String structure WideUniqueString : UNIQUE_STRING where String = WideString
This structure provides an efficient representation for strings that guarantees that equal strings share their representation. Such strings are also known as internalized string or symbols.
Imported implicitly.
signature UNIQUE_STRING = sig eqtype string eqtype unique_string type t = unique_string val unique : string -> unique_string val string : unique_string -> string val equal : unique_string * unique_string -> bool val compare : unique_string * unique_string -> order val hash : unique_string -> int end
The type of uniquely represented strings. Equality is defined structurally.
Creates a unique string with content s. If a unique string with the same content already exists, that one is returned.
Extracts the content of the unique string s. It holds that
string (unique s) = s
An explicit equality function on unique strings. Equivalent to op=.
Performs a lexicographic comparison of the content of the unique strings. Equivalent to
compare (string us1, string us2)
A hash function for unique strings. Hashing is constant time.