Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add Functor#composeBifunctor #4434

Merged

Conversation

armanbilge
Copy link
Member

This PR proposes a different encoding of #4362 (note, which is not yet released). /cc @bpholt

Specifically, Cats has a precedent of offering various compose methods for creating nested instances, but I'm not sure if there is much precedent for offering these instances as implicits. Furthermore as noted in #4362 inference does not work very well for this implicit anyway.

So I think replacing the implicit with a composeBifunctor method may yield better and more consistent ergonomics i.e. Instead of:

Bifunctor[λ[(A, B) => F[(A, B)]]].leftMap(fab)(f)

now you would write:

Functor[F].composeBifunctor[(*, *)].leftMap(fab)(f)
// or
F.composeBifunctor[(*, *)].leftMap(fab)(f)

Thoughts?

@bpholt
Copy link
Member

bpholt commented May 5, 2023

This seems pretty reasonable to me!

@armanbilge armanbilge merged commit d5f7d63 into typelevel:main May 7, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants