Skip to content

Instantly share code, notes, and snippets.

@Jacoby6000
Forked from zeryx/argonaut_match.scala
Last active September 16, 2016 17:04
Show Gist options
  • Save Jacoby6000/d7ad87db8dd2765600863e879587a254 to your computer and use it in GitHub Desktop.
Save Jacoby6000/d7ad87db8dd2765600863e879587a254 to your computer and use it in GitHub Desktop.
sealed trait Response
case class Question(...) extends Response
case class Respond(...) extends Response
case class Batch(...) extends Response
def apply(input: String): JsonElement = {
input.decodeOption[Response] match {
case Some(q: Question) => {
???
}
case Some(r: Respond) => {
???
}
case Some(b: Batch) => {
???
}
case _ => println(s"failed to parse")
}
}
Error:(14, 11) diverging implicit expansion for type argonaut.DecodeJson[X]
starting with method NonEmptyListDecodeJson in trait DecodeJsons
input.decodeOption match {
Error:(14, 11) not enough arguments for method decodeOption: (implicit evidence$6: argonaut.DecodeJson[X])Option[X].
Unspecified value parameter evidence$6.
input.decodeOption match {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment