Bool
structureThe Bool structure provides some basic operations on boolean values.
signature BOOL
structure Bool
: BOOL
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
datatype bool
not b
fromString s
scan getc strm
"true"
and "false"
are converted to the corresponding boolean values, respectively.
The function fromString
takes a string s as its source of characters. It returns SOME b
for a scanned value b; otherwise it returns NONE. Note that the function fromString
is equivalent to StringCvt.scanString scan
.
The function scan
takes a character stream reader getc and a stream strm. On successful scanning of a boolean value, it returns SOME(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
"true"
or "false"
, of the boolean value b.
StringCvt
Last Modified February 25, 1997
Comments to John Reppy.
Copyright © 1997 Bell Labs, Lucent Technologies