Subtype polymorphism in shapeless mapping
问题 I've constructed the following: import shapeless._ import poly._ object Main { def main(args: Array[String]) = { object iterateOverHList extends (List ~> Iterator) { def apply[T](it: List[T]) = it.iterator } val x = List(1,2,3) :: List("cat","dog") :: HNil val xIt = x map iterateOverHList } } The above code works great and is awesome. However, I still want more. I would like to, rather than specifying that my HList will contain Lists, allow any Iterable. Like this: import shapeless._ import