All Downloads are FREE. Search and download functionalities are using the official Maven repository.

medeia.generic.GenericEncoderInstances.scala Maven / Gradle / Ivy

The newest version!
package medeia.generic

import medeia.generic.util.VersionSpecific.Lazy
import org.mongodb.scala.bson.BsonDocument
import shapeless.LabelledGeneric

trait GenericEncoderInstances {
  implicit def genericEncoder[Base, H](implicit
      generic: LabelledGeneric.Aux[Base, H],
      hEncoder: Lazy[ShapelessEncoder[Base, H]]
  ): GenericEncoder[Base] =
    value => hEncoder.value.encode(generic.to(value), BsonDocument())
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy