bimap -package:pgp-wordlist -package:base-prelude package:bimap
Bidirectional mapping between two key types
A data structure representing a bidirectional mapping between two key
types. Each value in the bimap is associated with exactly one value of
the opposite type.
An implementation of bidirectional maps between values of two key
types. A
Bimap is essentially a bijection between subsets of
its two argument types.
Each element of the left-hand type is associated with an element of
the right-hand type, and vice-versa, such that the two mappings are
inverses. Deleting an element will cause its twin to be deleted, and
inserting a pair of elements will cause any overlapping bindings to be
deleted.
Most functions implicitly consider the left-hand type to be the key,
and the right-hand type to be the value. Functions with an
R
suffix reverse this convention, treating the right-hand type as the
key and the left-hand type as the value.
A bidirectional map between values of types a and b.