Portability | portable |
---|---|

Stability | provisional |

Maintainer | atzeus@gmail.org |

Safe Haskell | None |

A set of `HKey`

s

- data HKeySet
- empty :: HKeySet
- singleton :: HKey s a -> HKeySet
- union :: HKeySet -> HKeySet -> HKeySet
- unions :: [HKeySet] -> HKeySet
- null :: HKeySet -> Bool
- size :: HKeySet -> Int
- member :: HKey s a -> HKeySet -> Bool
- insert :: HKey x a -> HKeySet -> HKeySet
- delete :: HKey s a -> HKeySet -> HKeySet
- difference :: HKeySet -> HKeySet -> HKeySet
- intersection :: HKeySet -> HKeySet -> HKeySet
- overlap :: HMap -> HKeySet -> Bool
- sameKeys :: HMap -> HKeySet -> Bool
- removeKeys :: HMap -> HKeySet -> HMap

# Documentation

# Construction

# Combine

union :: HKeySet -> HKeySet -> HKeySetSource

*O(n+m)* Construct a key set containing all elements from both sets.

To obtain good performance, the smaller set must be presented as the first argument.

unions :: [HKeySet] -> HKeySetSource

Construct a key set containing all elements from a list of key sets.

# Basic interface

member :: HKey s a -> HKeySet -> BoolSource

*O(min(n,W))* Return `True`

if the given value is present in this
set, `False`

otherwise.

delete :: HKey s a -> HKeySet -> HKeySetSource

*O(min(n,W))* Remove the specified value from this set if
present.

# Difference and intersection

difference :: HKeySet -> HKeySet -> HKeySetSource

*O(n)* Difference of two sets. Return elements of the first set
not existing in the second.

intersection :: HKeySet -> HKeySet -> HKeySetSource

*O(n)* Intersection of two sets. Return elements present in both
the first set and the second.

# KeySet-HMap functions

removeKeys :: HMap -> HKeySet -> HMapSource

*O(n)*. Remove the keys from the keyset from the map.