The Bool structure
The Bool structure provides some basic operations on boolean values.
Synopsis
signature BOOL
structure Bool : BOOL
Interface
datatype bool = datatype bool
val not : bool -> bool
val fromString : string -> bool option
val scan : (char, 'a) StringCvt.reader -> 'a -> (bool * 'a) option
val toString : bool -> string
Description
-
datatype bool -
-
not b -
returns the logical negation of the boolean value b.
-
fromString sscan getc strm -
scan a boolean value from a stream of characters. Ignoring case and initial whitespace, the sequences
"true"and"false"are converted to the corresponding boolean values, respectively.The function
fromStringtakes a string s as its source of characters. It returnsSOME bfor a scanned value b; otherwise it returns NONE. Note that the functionfromStringis equivalent toStringCvt.scanString scan.The function
scantakes a character stream reader getc and a stream strm. On successful scanning of a boolean value, it returnsSOME(b, strm'), where b is the scanned value and strm' is the remaining character stream. The type of scan can also be written as(char, 'a) StringCvt.reader -> (bool, 'a) StringCvt.reader.
-
toString b -
returns the string representation, which is either
"true"or"false", of the boolean value b.
See Also
StringCvt