Consider the following example:
import shapeless._
case class Foo(bar: String, baz: Boolean)
val labl = LabelledGeneric[Foo]
Now, the type
You can obtain the keys of the record (as Symbol
s) via shapeless.ops.record.Keys
.
This
import shapeless._
import shapeless.ops.record._
case class Foo(bar: String, baz: Boolean)
val labl = LabelledGeneric[Foo]
val keys = Keys[labl.Repr].apply
println(keys)
println(keys.toList.map(_.name))
results in
'bar :: 'baz :: HNil
List(bar, baz) : List(String)