Safe Haskell | None |
---|---|

Language | Haskell2010 |

- data Set a
- singleton :: Ord a => a -> a -> Set a
- member :: Ord a => a -> Set a -> Bool
- difference :: (Ord a, Enum a) => Set a -> Set a -> Set a
- aboveInclusive :: Ord a => a -> Set a -> Set a
- belowInclusive :: Ord a => a -> Set a -> Set a
- betweenInclusive :: Ord a => a -> a -> Set a -> Set a
- foldr :: (a -> a -> b -> b) -> b -> Set a -> b
- fromList :: (Ord a, Enum a) => [(a, a)] -> Set a
- fromListN :: (Ord a, Enum a) => Int -> [(a, a)] -> Set a

# Documentation

*O(1)* Create a diet set with a single element.

*O(n + m*log n)* Subtract the subtrahend of size `m`

from the
minuend of size `n`

. It should be possible to improve the improve
the performance of this to *O(n + m)*. Anyone interested in doing
this should open a PR.

# Split

*O(n)* The subset where all elements are greater than
or equal to the given value.

*O(n)* The subset where all elements are less than
or equal to the given value.

*O(n)* The subset where all elements are greater than
or equal to the lower bound and less than or equal to
the upper bound.