Safe HaskellSafe

SetAsSortedList

Description

Sets as Sorted Lists

Synopsis

Documentation

data Set a Source #

Sets are represented by sorted lists.

Instances

(Ord a, Show a) => Show (Set a) # 

Methods

showsPrec :: Int -> Set a -> ShowS #

show :: Set a -> String #

showList :: [Set a] -> ShowS #

empty :: Set a Source #

The empty set.

insert :: Ord a => a -> Set a -> Set a Source #

Inserting single elements into Sets.

mem :: Ord a => a -> Set a -> Bool Source #

Checking for set membership.

union :: Ord a => Set a -> Set a -> Set a Source #

The union of two Sets.

diff :: Ord a => Set a -> Set a -> Set a Source #

The difference between two Sets.

toList :: Set a -> [a] Source #

Obtain the underlying list.