-
-
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
many kernel algebraic typeclasses should be Invariant
#1904
Comments
Shall we schedule this in RC1? |
I would like to. I hate when we have obvious instances for our own types that we don't ship. |
Hey @johnynek, can you elaborate a bit on what you mean by this? :) Monoid[A].imap(aToB)(bToA) I don't think we have these for any of the other kernel classes apart from |
Concretely:
|
I like the idea of having everything in |
I think these are so rarely used, I don't mind breaking the API to make it consistent current cats practice before 1.0 |
I'll submit a PR soon :) |
Fixed by #1914 :) |
If you have
Invariant[M]
and an isomorphism (or bijection)A => B, B => A
then you can go betweenM[A] <=> M[B]
. This can be very useful when combined with shapeless which can generate iso morphisms between case classes and tuples, etc...However, Semigroup, Semilattice, Monoid, Group, etc... are left out of that as far as I can see.
It would be nice to have instances for those in
object Invariant
so they could be used without import.The text was updated successfully, but these errors were encountered: