-
-
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
Add Align typeclass #3076
Add Align typeclass #3076
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3076 +/- ##
==========================================
+ Coverage 93.17% 93.31% +0.13%
==========================================
Files 372 375 +3
Lines 7182 7371 +189
Branches 199 215 +16
==========================================
+ Hits 6692 6878 +186
- Misses 490 493 +3
Continue to review full report at Codecov.
|
build.sbt
Outdated
@@ -401,6 +401,9 @@ def mimaSettings(moduleName: String) = | |||
exclude[MissingClassProblem]( | |||
"cats.kernel.compat.scalaVersionMoreSpecific$suppressUnusedImportWarningForScalaVersionMoreSpecific" | |||
) | |||
) ++ //abstract package private classes | |||
Seq( | |||
exclude[DirectMissingMethodProblem]("cats.data.AbstractNonEmptyInstances.this") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure this doesn't break BC? If we are sure maybe add a test in binCompatTest
? If not can we just add a separate method to provide the instance for Align
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some tests there, I think that should suffice, WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that shall do. thanks!
On a slightly related note, since we have been updating the build, I am a bit nervous that if something breaks binCompatTest
, we wouldn't know. I'll create an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just makes me vaguely uncomfortable. It's only used twice and it seems like it'd be almost equivalently noisy just to write out the new AbstractNonEmptyInstances[F, NEF] with Align[NEF]
in those two places.
I know we don't promise bincompat for people using Java, etc., but breaking it for the sake of saving a few lines doesn't feel ideal.
just added some more additional comments. Sorry I couldn't find the chunk of time to review it in one go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Only partially related but I recently implemented very similar functionality (esp. |
@djspiewak in my day-to-day use, I find it more convenient having leaf type classes encoded this way than inheritance. IMO the benefit outweight the benefit of having a uniform encoding for all type classes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't really like the "change our inheritance encoding as we go" approach but that ship sailed long ago I guess. 😄
I've got some nitpicks but nothing I see as an absolute blocker.
build.sbt
Outdated
@@ -401,6 +401,9 @@ def mimaSettings(moduleName: String) = | |||
exclude[MissingClassProblem]( | |||
"cats.kernel.compat.scalaVersionMoreSpecific$suppressUnusedImportWarningForScalaVersionMoreSpecific" | |||
) | |||
) ++ //abstract package private classes | |||
Seq( | |||
exclude[DirectMissingMethodProblem]("cats.data.AbstractNonEmptyInstances.this") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just makes me vaguely uncomfortable. It's only used twice and it seems like it'd be almost equivalently noisy just to write out the new AbstractNonEmptyInstances[F, NEF] with Align[NEF]
in those two places.
I know we don't promise bincompat for people using Java, etc., but breaking it for the sake of saving a few lines doesn't feel ideal.
@travisbrown I addressed your points :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LukaJCB Looks good to me, thanks!
Should fix #1263 while replacing #1755 by @julianmichael who did most of the work.