Created
October 27, 2016 15:20
-
-
Save kevinmeredith/ca04a862c778fa8e9fc60a1257179533 to your computer and use it in GitHub Desktop.
Type-class within case class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| trait Reads[A] | |
| case class Service(a: String) { | |
| implicit val xReads = X.reads(this) | |
| } | |
| case class X(y: Int) | |
| object X { | |
| def reads(s: Service): Reads[X] = new Reads[X] {} | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment