-
-
Save afsalthaj/67259a39c54dc7ae897a35882ff94288 to your computer and use it in GitHub Desktop.
This file contains 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
case class Something(value: Int) | |
// We have implicit EncodeJson available for Int. | |
def toJson(a: Int) = EncodeJson[Int].toJson(a) | |
def toJson(a: Something): EncodeJson[Something] = | |
EncodeJson[Int].contramap { _.value } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment