Safe Haskell | None |
---|

- data Set a
- empty :: Ord a => Set a
- null :: Ord a => Set a -> Bool
- size :: Ord a => Set a -> Int
- member :: Ord a => a -> Set a -> Bool
- memberSplay :: Ord a => a -> Set a -> (Bool, Set a)
- insert :: Ord a => a -> Set a -> Set a
- delete :: Ord a => a -> Set a -> Set a
- union :: Ord a => Set a -> Set a -> Set a
- difference :: Ord a => Set a -> Set a -> Set a
- intersection :: Ord a => Set a -> Set a -> Set a
- map :: (Ord a, Ord b) => (a -> b) -> Set a -> Set b
- fromList :: Ord a => [a] -> Set a

# Documentation

memberSplay :: Ord a => a -> Set a -> (Bool, Set a)Source

Check if `a`

is a member, and return a set splayed to `a`

.
The return set is splayed to an element near `a`

if `a`

isn't in the
set.

union :: Ord a => Set a -> Set a -> Set aSource

Construct a set containing all elements from both sets.

The smaller set should be presented as the second argument.

difference :: Ord a => Set a -> Set a -> Set aSource

Difference of two sets. Contains elements of the first set that are not present in the second.

intersection :: Ord a => Set a -> Set a -> Set aSource

Intersection of two sets. Contains all elements which are in both sets.

map :: (Ord a, Ord b) => (a -> b) -> Set a -> Set bSource

Transform this set by applying a function to every value.

fromList :: Ord a => [a] -> Set aSource

Construct a `Set`

from a list of elements.

The Set is created by calling `fromListBalance`

.