Safe Haskell | None |
---|
This module defines typable indices and convenience functions. Should
be probably considered private to IxSet
.
- data Ix a = forall key . (Typeable key, Ord key) => Ix (Map key (Set a)) (a -> [key])
- insert :: (Ord a, Ord k) => k -> a -> Map k (Set a) -> Map k (Set a)
- delete :: (Ord a, Ord k) => k -> a -> Map k (Set a) -> Map k (Set a)
- insertList :: (Ord a, Ord k) => [(k, a)] -> Map k (Set a) -> Map k (Set a)
- deleteList :: (Ord a, Ord k) => [(k, a)] -> Map k (Set a) -> Map k (Set a)
- union :: (Ord a, Ord k) => Map k (Set a) -> Map k (Set a) -> Map k (Set a)
- intersection :: (Ord a, Ord k) => Map k (Set a) -> Map k (Set a) -> Map k (Set a)
Documentation
Ix
is a Map
from some Typeable
key to a Set
of values for
that key. Ix
carries type information inside.
forall key . (Typeable key, Ord key) => Ix (Map key (Set a)) (a -> [key]) |
insert :: (Ord a, Ord k) => k -> a -> Map k (Set a) -> Map k (Set a)Source
Convenience function for inserting into Map
s of Set
s as in
the case of an Ix
. If they key did not already exist in the
Map
, then a new Set
is added transparently.
delete :: (Ord a, Ord k) => k -> a -> Map k (Set a) -> Map k (Set a)Source
Convenience function for deleting from Map
s of Set
s. If the
resulting Set
is empty, then the entry is removed from the Map
.
insertList :: (Ord a, Ord k) => [(k, a)] -> Map k (Set a) -> Map k (Set a)Source
Helper function to insert
a list of elements into a set.
deleteList :: (Ord a, Ord k) => [(k, a)] -> Map k (Set a) -> Map k (Set a)Source
Helper function to delete
a list of elements from a set.
union :: (Ord a, Ord k) => Map k (Set a) -> Map k (Set a) -> Map k (Set a)Source
Take union of two sets.
intersection :: (Ord a, Ord k) => Map k (Set a) -> Map k (Set a) -> Map k (Set a)Source
Take intersection of two sets