The Standard ML Basis Library


The Bool structure

The Bool structure provides some basic operations on boolean values.


Synopsis

signature BOOL
structure Bool : BOOL

Interface

datatype bool = true | false
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
The builtin type of booleans.

Question:

Change to datatype bool = datatype bool when supported by DTD



not b
returns the logical negation of the boolean value b.

fromString s
scan 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 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
returns the string representation, which is either "true" or "false", of the boolean value b.


See Also

StringCvt

[ INDEX | TOP | Parent | Root ]

Last Modified January 21, 1997
Copyright © 1996 AT&T