Two-way Hash Table in Erlang

I'm trying to come up with a dictionary-like data structure that I can use in Erlang. The goal is to guarantee that all the values, as well as the keys, are unique. I can do it with explicit consistency checks after every modification, but I'm hoping there's an obscure type that does this for me. Is there one? If not, is there a better way than wrapping a check into every function that modifies the data (or returns a slightly different copy)?

I'm expecting to have at least 120 elements and no more than a few thousand, in case that matters.

6
задан nmichaels 28 October 2010 в 17:31
поделиться