Copyright | (c) Atze van der Ploeg 2013 |
---|---|

License | BSD-style |

Maintainer | atzeus@gmail.org |

Stability | provisional |

Portability | portable |

Safe Haskell | None |

Language | Haskell98 |

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 -> HKeySet Source

*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] -> HKeySet Source

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

# Basic interface

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

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

# Difference and intersection

difference :: HKeySet -> HKeySet -> HKeySet Source

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

intersection :: HKeySet -> HKeySet -> HKeySet Source

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

# KeySet-HMap functions

removeKeys :: HMap -> HKeySet -> HMap Source

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