-
-
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 Comparison
to cats
package
#2110
Conversation
Comparison
to Cats packageComparison
to cats
package
Codecov Report
@@ Coverage Diff @@
## master #2110 +/- ##
==========================================
+ Coverage 94.79% 94.79% +<.01%
==========================================
Files 325 325
Lines 5494 5495 +1
Branches 219 218 -1
==========================================
+ Hits 5208 5209 +1
Misses 286 286
Continue to review full report at Codecov.
|
Thanks @kailuowang! Should the type be exported as well? |
@@ -90,6 +90,7 @@ package object cats { | |||
val Eq = cats.kernel.Eq | |||
val PartialOrder = cats.kernel.PartialOrder | |||
val Order = cats.kernel.Order | |||
val Comparison = cats.kernel.Comparison |
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.
do we not need the type Comparison
?
I don't see much of the benefit of aliasing a comparison b match {
case Comparison.GreaterThan => ...
...
} Of course if we want to pass the comparison result around we would need the type, but how often is that? I was just trying to do the minimum (and minimize namespace pollution) to satisfy the original request. |
I think it is inconsistent to be able to do |
For pattern matching accessing the data constructors is indeed sufficient. I don’t have a concrete usecase for passing around a comparison currently but it looks inconsistent with the rest of the kernel re-exports. Namespace Pollution is an interesting consideration but I’m not familiar with the trade offs here. My desire is to stick with the cats, cats.data and cats.implicits imports :-) |
for the sake of consistency
Consistency is a good argument. I added the type. |
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 again!
👍 |
fixes #2109