-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rethinking cats.data.Prod #874
Comments
Another argument for using the tuple directly and putting it on the type class |
I preferred defining |
You can still get an |
To me that makes sense. |
I'll take on adding |
Closing in favor of #968 |
For product composition of type classes we are using
cats.data.Prod
which is defined likewhich fixes
F
andG
to be unary type constructors. This works fine when defining product composition for type classes abstracting over unary type constructors likeFunctor
andApply
. But for type classes likeBifunctor
andBifoldable
which abstract over binary type constructors, they also have product composition but they can't usecats.data.Prod
. We can just have thecompose
on those type classes return the tuple directlyLambda[(A, B) => (F[A, B], G[A, B])]
, but that would be inconsistent with our use ofProd
in the other type classes.I looked in the Essence of the Iterator Pattern paper which I believe inspired
cats.data.Prod
and dont' see them using it with theBifoldable
-y stuff./cc @eed3si9n since he added
Prod
The text was updated successfully, but these errors were encountered: