-
Notifications
You must be signed in to change notification settings - Fork 708
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
Macro to derive ordering for case class #1054
Comments
Ordering is extremely easy. I'll put that in a patch the bijection What semantics do we want the monoid one to have? To be identical to the |
What's wrong with depending on bijection? To start with just use the bijection to tuple, the tuple monoid, then back again. (In fact is there not an implicit bijection monoid that does this already?) |
There is no bijection from any case class to tuple, but you're right, with |
Actually with the bijection code I think I can make a converter for any |
twitter/bijection#179 + twitter/bijection#183 provide a very nice way to get these for free. |
@jcoveney Is it tomorrow yet? |
This was done. See this wiki page here: |
Thanks :) On Tue, Oct 4, 2016 at 1:51 PM P. Oscar Boykin [email protected]
|
@jcoveney
What we want is this:
case class MyClass(name: String, age: Int)
object MyClass {
def ordering = deriveOrdering[MyClass]
def monoid = deriveMonoid[MyClass]
}
The text was updated successfully, but these errors were encountered: