Given the following definitions:
class R[T] class A class B class C
It works:
val s1 = new R[A] :: new R[B] :: HNil val r1 = s1.toList
So far this is not the case:
val s2 = new R[A] :: new R[B] :: new R[C] :: HNil val r2 = s2.toList // could not find implicit value for parameter toList: // shapeless.ToList[shapeless.::[R[A], // shapeless.::[R[B],shapeless.::[R[C],shapeless.HNil]]],Lub]
Where i expect:
Pseudo-solution:
Set yourself:
val r3 = s2.toList(ToList.hlistToList[R[A], R[B], ::[R[C], HNil], R[_ >: A with B with C]])
This, of course, is not a solution, because it eliminates all the advantages of HLists ( HList provided by the caller along with all the necessary implications).
Explanation
I am glad if I get List[R[_]] at the end without type restrictions.
source share