map -package:containers -package:dense-linear-algebra package:bimap is:module

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.