Skip to content

Instantly share code, notes, and snippets.

@pjrt
Created February 19, 2021 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pjrt/081674c66cf595ff74b8dcb24f664a3f to your computer and use it in GitHub Desktop.
Save pjrt/081674c66cf595ff74b8dcb24f664a3f to your computer and use it in GitHub Desktop.
trait JsonParser[A] {
def parse(json: Json): JsonResult[A]
}
object JsonParser {
def parse[A](json: Json)(implicit A: JsonParser[A]) = A.parse(json)
def deriveInstance[A]: JsonParser[A] = callSomeMacroSystem
object auto {
implicit def autoInstance[A]: JsonParser[A] = deriveInstance
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment