Next Previous Contents

11. NDSet

This library provides an implementation of sets for which only the following operations are available:

        data NDSet
        instance Functor NDSet
        instance Monad NDSet

        union                   :: NDSet a -> NDSet a -> NDSet a
        choose                  :: NDSet a -> IO a
        unsafePromiseSingleton  :: NDSet a -> a

The name stands for "Non-Deterministic Sets", because they have the property that the only way to view the contents of the set is to choose an element using choose. The actual element chosen is undefined (the IO monad provides the nondeterminism). NDSets are always non-empty, so choose always succeeds.

NDSets are used by the Exception library (Section Exception).


Next Previous Contents