HMap-1.1.2: Fast heterogeneous maps and unconstrained typeable like functionality.

Safe HaskellNone




A set of HKeys



data HKeySet Source

The type of hetrogenous key sets.


empty :: HKeySetSource

O(1) Construct an empty key set.

singleton :: HKey s a -> HKeySetSource

O(1) Construct a set with a single element.


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

null :: HKeySet -> BoolSource

O(1) Return True if this key set is empty, False otherwise.

size :: HKeySet -> IntSource

O(n) Return the number of elements in this set.

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

O(min(n,W)) Return True if the given value is present in this set, False otherwise.

insert :: HKey x a -> HKeySet -> HKeySetSource

O(min(n,W)) Add the specified value to this set.

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

overlap :: HMap -> HKeySet -> BoolSource

O(n). Does the map carry any of the keys?

sameKeys :: HMap -> HKeySet -> BoolSource

O(n). Do the keyset and the map have the same keys?

removeKeys :: HMap -> HKeySet -> HMapSource

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