[Haskell-cafe] Re: Bi-directional Maps

apfelmus apfelmus at quantentunnel.de
Tue Aug 21 09:37:24 EDT 2007

Hugh Perkins wrote:
>> Exactly. For this to work there needs to be the constraint that there's a
>> one-to-one mapping in each direction. The Bimap should have the uniqueness
>> promise that "Set (k, v)" gives. Yet you should be able to search on either
>> tuple value.
> Or... have the possibility of returning a list of values.
> Arguably there are two possible implementations, one that enforces
> one-to-one mapping, and one which allows multiple values, in either
> direction.

Terminology reminder :)
- the latter is called "(binary) relation"
- the former would be a "bijection"


More information about the Haskell-Cafe mailing list