-
-
Save Jacoby6000/d7ad87db8dd2765600863e879587a254 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
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") | |
} | |
} |
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
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