I have these:
trait A[T]
class X
class Y
object B {
def method[H :< HList](h: H) = h.toList[A[_]]
}
Parameter h
of method
will always be a HList of A[T], like new A[X] :: new A[Y] :: HNil.
I would like to convert the HList to a List[A[_]].
How can I get this with generic code, because trait HList doesn't have the toList method()?