Holumbus-Distribution-0.1.0: intra- and inter-program communicationSource codeContentsIndex
Holumbus.Data.MultiMap
Portabilityportable
Stabilityexperimental
MaintainerStefan 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.
show/hide 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 aSource
The empty MultiMap.
null :: (Ord k, Ord a) => MultiMap k a -> BoolSource
Test, if the MultiMap is empty.
insert :: (Ord k, Ord a) => k -> a -> MultiMap k a -> MultiMap k aSource
Inserts an element in the MultiMap.
insertSet :: (Ord k, Ord a) => k -> Set a -> MultiMap k a -> MultiMap k aSource
Inserts multiple elements in a set to the MultiMap.
insertKeys :: (Ord k, Ord a) => [k] -> Set a -> MultiMap k a -> MultiMap k aSource
Inserts multiple keys with the same values.
lookup :: (Ord k, Ord a) => k -> MultiMap k a -> Set aSource
Gets all different elements for one key or an empty set.
keys :: (Ord k, Ord a) => MultiMap k a -> Set kSource
Get all different keys from the map.
elems :: (Ord k, Ord a) => MultiMap k a -> Set aSource
Get all different values in the map without regarding their keys.
filterElements :: (Ord k, Ord a) => [k] -> MultiMap k a -> Set aSource
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 -> BoolSource
Test, if a key is in the Map.
delete :: (Ord k, Ord a) => k -> Maybe a -> MultiMap k a -> MultiMap k aSource
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 aSource
Deletes a whole key from the map.
deleteElem :: (Ord k, Ord a) => k -> a -> MultiMap k a -> MultiMap k aSource
Deletes a single Element from the map.
deleteAllElems :: (Ord k, Ord a) => a -> MultiMap k a -> MultiMap k aSource
Deletes all Elements (*,a) (slow!!!).
fromList :: (Ord k, Ord a) => [(k, Set a)] -> MultiMap k aSource
Creates a MultiMap from a list of pairs (key,set value).
fromTupleList :: (Ord k, Ord a) => [(k, a)] -> MultiMap k aSource
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.
Produced by Haddock version 2.6.1