I have the next code
trait A { val id: Int }
case class B(id: Int) extends A
case class C(id: Int, name: String) extends A
i want to define common lens for all class hierarchy:
import shapeless._
import lens._
val idLens = lens[A] >> 'id
But i get error: could not find implicit value for parameter mkLens: shapeless.MkFieldLens[A,Symbol with shapeless.tag.Tagged[String("id")]]
Is it possible to define lens for all children of trait A
?