-
-
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
conversion PartialOrder
to PartialOrdering
and Hash
to Hashing
#2116
Conversation
@denisrosset , will you take a look as well? |
Codecov Report
@@ Coverage Diff @@
## master #2116 +/- ##
==========================================
+ Coverage 94.62% 94.63% +<.01%
==========================================
Files 325 325
Lines 5511 5514 +3
Branches 207 213 +6
==========================================
+ Hits 5215 5218 +3
Misses 296 296
Continue to review full report at Codecov.
|
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!
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.
LGTM but I'd like to get input from @johnynek and/or @denisrosset
Why do both the core instances and the |
def fromPartialOrdering[A](implicit ev: PartialOrdering[A]): PartialOrder[A] = from[A] { (a, b) => | ||
ev.tryCompare(a, b).fold(Double.NaN)(_.toDouble) | ||
} | ||
} |
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'd prefer extending the PartialOrder
trait here instead of having so many lambdas (from
and the fold
).
@denisrosset the core instances extends it so that it's available through |
So, if I understand correctly, the conversion will always be available regardless of the |
no, it will only be available through Update: To be clear, the original way it was added was basically wrong - it's added as an implicit but in a companion that won't get searched. |
I suggest to document this, implicits are confusing enough. If you don't want to modify this PR, I'll add a comment on the Google doc and will have a pass a it later. |
A couple of comments.
This is corrected by the commit: |
Awesome @denisrosset! Would you like to PR that to Kai's branch? :) |
@denisrosset I will address your feedbacks. |
As far as I can tell from the source, neither Algebra, nor Spire or Algebird make use of |
This is probably a good reason for not providing any |
@denisrosset I've added the conversions to |
Except that the documentation for
|
@denisrosset is it the same way in 2.11 and 2.10? |
@denisrosset that seems right. I couldn't find from the original PR why that comment was added. |
0f34e7c
to
262418f
Compare
To address some items in #2093
Note that this code change is binary compatible in kernel (I tested Mima without any of the exceptions I added) but not binary compatible in core.