-
-
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
Remove Order constraints from SortedMap and NonEmptyMap instances #3397
Conversation
4776909
to
8aeb3af
Compare
Codecov Report
@@ Coverage Diff @@
## master #3397 +/- ##
==========================================
+ Coverage 92.49% 92.53% +0.04%
==========================================
Files 378 379 +1
Lines 7956 7999 +43
Branches 227 224 -3
==========================================
+ Hits 7359 7402 +43
Misses 597 597
Continue to review full report at Codecov.
|
@travisbrown I think we should make a decision on this one before 2.2.0 because of bincompat - it modifies directly the new implicit scope instances. |
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.
Looks good to me, just need to fix that one merge conflict. :)
if (as.nonEmpty) Option(create(as)) else None | ||
|
||
def fromMapUnsafe[K: Order, A](m: SortedMap[K, A]): NonEmptyMap[K, A] = | ||
@deprecated("Use fromMap override without Order", "2.2.0-M2") |
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.
super nitpick 😄 , now that M2 is out
@deprecated("Use fromMap override without Order", "2.2.0-M2") | |
@deprecated("Use fromMap override without Order", "2.2.0-M3") |
or if it doesn't make it for the M3 RC1 may be. Here and the others
The conflict seems pretty simple and I think doesn't require reformatting or anything, so I'll just resolve it here through the web interface if there are no objections (and we can update the |
Codecov Report
@@ Coverage Diff @@
## master #3397 +/- ##
==========================================
+ Coverage 91.99% 92.47% +0.48%
==========================================
Files 383 379 -4
Lines 8372 8003 -369
Branches 212 225 +13
==========================================
- Hits 7702 7401 -301
+ Misses 670 602 -68 |
Oh, looks like I was wrong and it does need a format. @joroKr21, sorry about that—I can grab your commits and open a new PR with them, or you could pull from here and push the format commit? |
Fine by me 👍 |
Superseded by #3473 |
SortedMap
carries around its own instance ofOrdering
so there is no need for an implicitOrder
constraint unless we have to create a newSortedMap
from scratch (e.g. inMonoid.empty
).Some of the removed constraints were simply not used (e.g.
Show
,Hash
), others were used only in some methods but not others (e.g.Traverse
) - note that the standard lib++
does not require anOrdering
.These inconsistencies are accidental at best and can lead to surprising behaviour at worst (when there are incoherent
Order
instances in a project).Closes #3223
Closes #2318