bitcoin-hs-0.0.1: Partial implementation of the Bitcoin protocol (as of 2013)

Safe HaskellSafe
LanguageHaskell98

Bitcoin.Misc.BiMap

Description

Bidirectional maps (bijections)

Synopsis

Documentation

data BiMap a b Source #

Constructors

BiMap 

Fields

empty :: (Ord a, Ord b) => BiMap a b Source #

toList :: (Ord a, Ord b) => BiMap a b -> [(a, b)] Source #

toListRev :: (Ord a, Ord b) => BiMap a b -> [(b, a)] Source #

fromList :: (Ord a, Ord b) => [(a, b)] -> BiMap a b Source #

lookup :: Ord a => a -> BiMap a b -> Maybe b Source #

lookupRev :: Ord b => b -> BiMap a b -> Maybe a Source #

insert :: (Ord a, Ord b) => a -> b -> BiMap a b -> BiMap a b Source #

In case there is a (partial) conflict with the existing BiMap, the conflicting pair is removed and the new pair is inserted.

delete :: (Ord a, Ord b) => a -> BiMap a b -> BiMap a b Source #

deleteRev :: (Ord a, Ord b) => b -> BiMap a b -> BiMap a b Source #