[containers-users] Request for comments on BiMap

Drup drupyog at zoho.com
Sat Feb 24 12:01:45 GMT 2018

Why not call this "Bijection" or "BijMap" ? BiMap simply implies two 
maps. This a bit more specific.

Le 23/02/2018 à 01:37, SP a écrit :
> I've started working on a BiMap, a map where (key, value) is also
> (value, key) in a one-to-one relationship.
> https://github.com/c-cube/ocaml-containers/compare/master...orbifx:bimap
> As I'm writing this I have written `empty`, `add`, `find_left` and
> `find_right`.
> The idea is that when adding a left-key, right-value to the BiMap, it
> doesn't just check for the preexistence of the left key, but also checks
> if the right value already has a left key and removes it if so. Vice
> versa for right key, left value.
> Please provide any comments and thoughts.
> One question I have is why are map values first in the order of
> parameters? For example:
> https://github.com/c-cube/ocaml-containers/blob/master/src/data/CCMultiMap.ml#L294 

More information about the Containers-users mailing list