This is a follow-up question of:
How to get the name of a case class field as a string/symbol at compile time using shapeless?
Assuming that I want to write a recursive converter that can convert a product type:
case class Prod (
a: Int,
b: String
)
into a Record, but unlike the above question which uses each case class fields (a, b) as keys, I want to use each class name or type/type-constructor name directly. So this product type becomes a Record at compile time:
"Int" ->> Int
"String" ->> String
(probably not a good enough use case, but you got the idea)
One key step of this is to use reflection to get the name of each class at compile time, and convert them into Singleton types or shapeless witness. I wonder if this capability is already provided somewhere? Or do I absolutely need a whitebox macro to make it happen?