Skip to content

Instantly share code, notes, and snippets.

@marcintustin
Created August 26, 2017 21:29
Show Gist options
  • Select an option

  • Save marcintustin/d77a063d0c22a3ef6d70fd3396c2535e to your computer and use it in GitHub Desktop.

Select an option

Save marcintustin/d77a063d0c22a3ef6d70fd3396c2535e to your computer and use it in GitHub Desktop.
implicit val ExtendedGreetingDecoder: Decoder[ExtendedGreeting] =
Decoder.instance { hello: io.circe.HCursor =>
for {
language <- hello.downField("language").as[String]
greeting <- hello.downField("greeting").as[Greeting]
} yield ExtendedGreeting(greeting, language)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment