Safe Haskell | None |
---|---|
Language | Haskell2010 |
Finite bijections (implemented as a pair of tree maps).
Synopsis
- data BiMap a b = BiMap {
- biMapThere :: Map a b
- biMapBack :: Map b a
- lookup :: Ord a => a -> BiMap a b -> Maybe b
- invLookup :: Ord b => b -> BiMap a b -> Maybe a
- empty :: BiMap a b
- singleton :: a -> b -> BiMap a b
- insert :: (Ord a, Ord b) => a -> b -> BiMap a b -> BiMap a b
- union :: (Ord a, Ord b) => BiMap a b -> BiMap a b -> BiMap a b
- fromList :: (Ord a, Ord b) => [(a, b)] -> BiMap a b
- toList :: BiMap a b -> [(a, b)]
Documentation
Finite bijective map from a
to b
. There, and back again.
BiMap | |
|
insert :: (Ord a, Ord b) => a -> b -> BiMap a b -> BiMap a b Source #
Insert. Overwrites existing value if present. O(Map.insert).
union :: (Ord a, Ord b) => BiMap a b -> BiMap a b -> BiMap a b Source #
Left-biased Union. O(Map.union).