The method below aims to get the field value of a single-field case class but it compiled failed because implicit not found.
import shapeless.Generic
import shapeless._
def main(args: Array[String]): Unit = {
getWrapperValue(Wrapper(42))
}
def getWrapperValue[A, H](input: A)
(implicit
gen: Generic.Aux[A, H :: HNil]): H =
gen.to(input).head
case class Wrapper(value: Int)
How to understand the explanation with the underline in document ?
I am confused why the compiler can’t find a Repr and ensure its length at the same time?