I have a HList of Nat, and I want to map over it
object NatToString extends Poly1 {
implicit def caseNat = at[Nat](_.toString)
}
val list = _5 :: _3 :: HNil
list.map(NatToString)
This code doesn't compile and throw:
could not find implicit value for parameter mapper:
shapeless.ops.hlist.Mapper[Main.Nat_to_String.type,shapeless.::[shapeless.Nat._5,shapeless.::[shapeless.Nat._3,shapeless.HNil]]]
But if I do exactly the same thing with Int (or String, or List, etc.) in place of Nat, it works perfectly.
How can I map over an HList of Nat ?