The Set type

Simon Marlow [email protected]
Thu, 21 Dec 2000 03:48:09 -0800

George Russell wrote:

> A minor quibble I know, but every time I use sets I want to 
> add/subtract single elements
> to/from them.  There is no function provided for doing this, 
> so instead you have to do
> union/delete with a singleton set constructed from the 
> element.

Done.  Set now has

        addToSet       :: Ord a => Set a -> a -> Set a
        delFromSet     :: Ord a => Set a -> a -> Set a

The names and argument order were chosen to be consistent with
FiniteMap, so don't complain :-)