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

Copyright (c) Atze van der Ploeg 2013 BSD-style atzeus@gmail.org provisional portable None Haskell98

Data.HKeySet

Description

A set of HKeys

Synopsis

# Documentation

data HKeySet Source #

The type of hetrogenous key sets.

# Construction

O(1) Construct an empty key set.

singleton :: HKey s a -> HKeySet Source #

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

# Combine

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 :: Foldable f => f HKeySet -> HKeySet Source #

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

# Basic interface

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

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

member :: HKey s a -> HKeySet -> Bool Source #

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

insert :: HKey x a -> HKeySet -> HKeySet Source #

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

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

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

# Difference and intersection

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

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

# KeySet-HMap functions

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

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

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