Closed bingis-khan closed 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.
I'm fine with this change in principle. Some comments:
lookup(R)
, not flip lookup(R)
. Was this
intentional or did you miss the flip?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: @.***>
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-
As the title suggests:
flip lookup
andflip lookupR
.lookup
note that mentions how this lookup compares to the Data.Map'slookup
function.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'slookup
ifm
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.