Created
November 22, 2019 16:18
-
-
Save hhalex/663a0c8a1985854f201578e3dbad5e1b to your computer and use it in GitHub Desktop.
Declaring a decoder for semi-automatic derivation
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 CustomStructure(a: Int) | |
object MyDecoders { | |
implicit customDecoder = deriveDecoder[CustomStructure] | |
} | |
object Main { | |
import MyDecoders._ | |
val decoded: CustomStructure = decode[CustomStructure]("{a:1}") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment