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

monocle.generic.CoProduct.scala Maven / Gradle / Ivy

There is a newer version: 1.5.1-cats
Show newest version
package monocle.generic

import monocle.Prism
import shapeless.Coproduct
import shapeless.ops.coproduct.{Inject, Selector}

object coproduct extends CoProductInstances


trait CoProductInstances {
  
  def coProductPrism[C <: Coproduct, A](implicit evInject: Inject[C, A], evSelector: Selector[C, A]): Prism[C, A] =
    Prism[C, A](evSelector.apply(_))(evInject.apply)
  

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy