My problem is that i want to mix in traits to some existing object instance
instead of doing
sealed trait Type
trait A extends Type
trait B extends Type
case class Basic(int, bool)
val someInt = 2
val someBool = False
val someType = "a"
someType match {
case "a" => new Basic(someInt, someBool) with A
case "b" => new Basic(someInt, someBool) with B
}
i would like to do new Basic() only once and then add somehow A and B
Is it possible to do it somehow with Shapeless ? I was hoping to be able to use Generic to get a HList, add the marker trait info in it, and convert it back to what would be a Basic with the trait attached. But I don't actually see how that would be possible with HList.