joelwilliamson / bimap

Bidirectional mapping between two key types
BSD 3-Clause "New" or "Revised" License
22 stars 8 forks source link

Make Bimap return Sets when appropriate #9

Open recursion-ninja opened 5 years ago

recursion-ninja commented 5 years ago

It would be nice if keys and keysR returned Set a instead of [a] by using the Data.Map.keysSet function. Set's are often preferable and this conversion would have a smaller constant factor than Set.fromListAsc . toMap. Plus there's always elems for getting the [a] type.

joelwilliamson commented 5 years ago

I would rather have new functions Bimap.keysSet and Bimap.keysSetR so that we can maintain backward compatibility and keep matching the interface of Prelude's Maps