-
-
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
UUID instances #1399
UUID instances #1399
Conversation
Current coverage is 91.69% (diff: 100%)@@ master #1399 diff @@
==========================================
Files 240 242 +2
Lines 3610 3614 +4
Methods 3546 3550 +4
Messages 0 0
Branches 63 63
==========================================
+ Hits 3310 3314 +4
Misses 300 300
Partials 0 0
|
Current coverage is 91.69% (diff: 100%)@@ master #1399 diff @@
==========================================
Files 240 242 +2
Lines 3610 3614 +4
Methods 3546 3546
Messages 0 0
Branches 63 67 +4
==========================================
+ Hits 3310 3314 +4
Misses 300 300
Partials 0 0
|
implicit val catsKernelStdOrderForUUID: Order[UUID] = new UUIDOrder | ||
} | ||
|
||
class UUIDOrder extends Order[UUID] { |
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 wonder if you would be willing to add fromComparable
to object Order
similar to the Show.fromToString
, and use it here. So, it would be a method like:
object Order {
def fromComparable[T <: Comparable]: Order[T] = new Order[T] {
...
}
}
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.
OK, hopefully I'll have some time for that during the weekend.
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.
Done in 6bf5a18.
package object uuid extends UUIDInstances | ||
|
||
trait UUIDInstances { | ||
implicit val catsKernelStdOrderForUUID: Order[UUID] = new UUIDOrder |
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.
if you do the below, you can do = Order.fromComparable[UUID]
👍 |
Thanks @durban, can you add a |
I agree with @peterneyens. Otherwise, LGTM too! Thanks! |
Order[UUID]
Show[UUID]