This PR is another potential solution to the uniquing problem.
In this approach, we do a best effort attempt to create a BijectiveDictionary from a Collection of left-right pairs.
If there are no conflicts, we return a .success with the completed BijectiveDictionary.
If there are conflicts, we insert as many non-conflicting values as possible. We collect conflicting values as an Array. Then we return a .conflicts with the partial BijectiveDictionary and the remaining conflicting Elements so that the user can handle the conflicts themselves.
This PR is another potential solution to the uniquing problem.
In this approach, we do a best effort attempt to create a
BijectiveDictionary
from a Collection of left-right pairs.If there are no conflicts, we return a
.success
with the completedBijectiveDictionary
.If there are conflicts, we insert as many non-conflicting values as possible. We collect conflicting values as an Array. Then we return a
.conflicts
with the partialBijectiveDictionary
and the remaining conflictingElement
s so that the user can handle the conflicts themselves.