Holumbus.Data.MultiMap
 Portability portable Stability experimental Maintainer Stefan Schmidt (stefanschmidt@web.de)
Description

Version : 0.1

This module provides a MultiMap, that means a Map, which can hold multiple values for one key, but every distinct value is only stores once. So adding the same key-value-pair twice will only create one new entry in the map.

This Map is helpfull to examine how many different key-values-pairs you have in your application.

Most of the functions are borrowed from Data.Map

Synopsis
 data MultiMap k a empty :: (Ord k, Ord a) => MultiMap k a null :: (Ord k, Ord a) => MultiMap k a -> Bool insert :: (Ord k, Ord a) => k -> a -> MultiMap k a -> MultiMap k a insertSet :: (Ord k, Ord a) => k -> Set a -> MultiMap k a -> MultiMap k a insertKeys :: (Ord k, Ord a) => [k] -> Set a -> MultiMap k a -> MultiMap k a lookup :: (Ord k, Ord a) => k -> MultiMap k a -> Set a keys :: (Ord k, Ord a) => MultiMap k a -> Set k elems :: (Ord k, Ord a) => MultiMap k a -> Set a filterElements :: (Ord k, Ord a) => [k] -> MultiMap k a -> Set a member :: (Ord k, Ord a) => k -> MultiMap k a -> Bool delete :: (Ord k, Ord a) => k -> Maybe a -> MultiMap k a -> MultiMap k a deleteKey :: (Ord k, Ord a) => k -> MultiMap k a -> MultiMap k a deleteElem :: (Ord k, Ord a) => k -> a -> MultiMap k a -> MultiMap k a deleteAllElems :: (Ord k, Ord a) => a -> MultiMap k a -> MultiMap k a fromList :: (Ord k, Ord a) => [(k, Set a)] -> MultiMap k a fromTupleList :: (Ord k, Ord a) => [(k, a)] -> MultiMap k a toList :: (Ord k, Ord a) => MultiMap k a -> [(k, Set a)] toAscList :: (Ord k, Ord a) => MultiMap k a -> [(k, Set a)]
Documentation
 data MultiMap k a Source
A MultiMap, it can hold more (different!!!) Elements for one key.
Instances
 (Eq k, Eq a) => Eq (MultiMap k a) (Ord k, Ord a) => Ord (MultiMap k a) (Show k, Show a) => Show (MultiMap k a)
 empty :: (Ord k, Ord a) => MultiMap k a Source
The empty MultiMap.
 null :: (Ord k, Ord a) => MultiMap k a -> Bool Source
Test, if the MultiMap is empty.
 insert :: (Ord k, Ord a) => k -> a -> MultiMap k a -> MultiMap k a Source
Inserts an element in the MultiMap.
 insertSet :: (Ord k, Ord a) => k -> Set a -> MultiMap k a -> MultiMap k a Source
Inserts multiple elements in a set to the MultiMap.
 insertKeys :: (Ord k, Ord a) => [k] -> Set a -> MultiMap k a -> MultiMap k a Source
Inserts multiple keys with the same values.
 lookup :: (Ord k, Ord a) => k -> MultiMap k a -> Set a Source
Gets all different elements for one key or an empty set.
 keys :: (Ord k, Ord a) => MultiMap k a -> Set k Source
Get all different keys from the map.
 elems :: (Ord k, Ord a) => MultiMap k a -> Set a Source
Get all different values in the map without regarding their keys.
 filterElements :: (Ord k, Ord a) => [k] -> MultiMap k a -> Set a Source
Like lookup keys, but an empty input list will give all elements back, not the empty set.
 member :: (Ord k, Ord a) => k -> MultiMap k a -> Bool Source
Test, if a key is in the Map.
 delete :: (Ord k, Ord a) => k -> Maybe a -> MultiMap k a -> MultiMap k a Source
Deletes an Element from the Map, if the data in Nothing, the whole key is deleted.
 deleteKey :: (Ord k, Ord a) => k -> MultiMap k a -> MultiMap k a Source
Deletes a whole key from the map.
 deleteElem :: (Ord k, Ord a) => k -> a -> MultiMap k a -> MultiMap k a Source
Deletes a single Element from the map.
 deleteAllElems :: (Ord k, Ord a) => a -> MultiMap k a -> MultiMap k a Source
Deletes all Elements (*,a) (slow!!!).
 fromList :: (Ord k, Ord a) => [(k, Set a)] -> MultiMap k a Source
Creates a MultiMap from a list of pairs (key,set value).
 fromTupleList :: (Ord k, Ord a) => [(k, a)] -> MultiMap k a Source
Creates a MultiMap from a list of tuples.
 toList :: (Ord k, Ord a) => MultiMap k a -> [(k, Set a)] Source
Transforms a MultiMap to a list of pairs (key,set value).
 toAscList :: (Ord k, Ord a) => MultiMap k a -> [(k, Set a)] Source
The same as toList, but the keys are in ascending order.