reactivemongo.bson
import reactivemongo.bson.{derived, BSONDocumentHandler} sealed trait Foo case class Bar(i: Int, s: String) extends Foo case class Baz(b: Boolean) extends Foo object Foo { implicit val codec: BSONDocumentHandler[Foo] = derived.codec }
Phantom type keeping track of the original type to derive a decoder for
Decoded type
As usual the derivation process is as follows: