Say that I have a trait Show[T]
such as the one in Scalaz: https://github.com/scalaz/scalaz/blob/scalaz-seven/core/src/main/scala/scalaz/Show.scala#L9
I also have a Shapeless HList
that may look like "1" :: 2 :: 3L :: HNil
.
Is there a way to find the Show
instance for each element and apply shows
such that I end up with "1" :: "2" :: "3L" :: HNil
?
If any element were of a type that did not have an implicit Show
instance in scope I would want a compile error.
I think that if I build up an HList
of the Show
instances I should be able to use zipApply
to get the HList
I want, but I don't know if there is a way to get have Scala infer the HList
of Show
instances instead of me building it up by hand.