joelwilliamson / bimap

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

Aesthetic changes: add (!?) and (!?>) operators + some docs. #15

Closed bingis-khan closed 2 years ago

bingis-khan commented 2 years ago

As the title suggests:

The last one is important, I think, because it wasn't immediately obvious (for me :) ) that MonadThrow includes Maybe and lookup works the same way as Data.Map's lookup if m is Maybe. Added this bit in the docs "for educational purposes", basically.

Again, really small change, but I think it'd make the library just this much nicer.

bingis-khan commented 2 years ago

As a side note, I originally forked this repository, because I was surprised that it has no Semigroup/Monoid instance. After looking into it, I'm pretty sure a non-trivial Semigroup instance is basically impossible.

joelwilliamson commented 2 years ago

I'm fine with this change in principle. Some comments:

Thanks for the PR.

On Tue, May 10, 2022 at 2:13 PM ????????????????? @.***> wrote:

As a side note, I originally forked this repository, because I was surprised that it has no Semigroup/Monoid instance. After looking into it, I'm pretty sure a non-trivial semigroup instance is basically impossible.

— Reply to this email directly, view it on GitHub https://github.com/joelwilliamson/bimap/pull/15#issuecomment-1122715414, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANG27AS533PFFFH67P7DL3VJKRKZANCNFSM5VSNLCHQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

bingis-khan commented 2 years ago

Oh no. I've accidentally removed the flip change while I was fiddling with git rebase. Yeah, it's totally not intentional! The (!?) link: https://hackage.haskell.org/package/containers-0.6.5.1/docs/Data-Map-Strict.html#v:-33--63-