Skip to content

Instantly share code, notes, and snippets.

@dcastro
Last active July 24, 2018 15:08
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 dcastro/f93bef4dbd2954ca0b9aafd37002311c to your computer and use it in GitHub Desktop.
Save dcastro/f93bef4dbd2954ca0b9aafd37002311c to your computer and use it in GitHub Desktop.
Json decoder/encoders typeclasses are lawless
import io.circe.syntax._
// hypothesis: ∀ x∈X, x.asJson.as[X] == Right(x)
// counterexample, nested options:
type X = Option[Option[Int]]
val x: X = Some(None)
x.asJson.as[X] == Right(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment