Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import shapeless._
- import shapeless.ops.hlist._
- import shapeless.ops.record._
- case class Foo(i: Int, b: String)
- object Main {
- def f[T, R <: HList, L <: HList]
- (g: LabelledGeneric.Aux[T, R])
- (implicit
- ks: Keys.Aux[R, L],
- tta: ToTraversable.Aux[L, Seq, Symbol],
- lub: LUBConstraint[L, Symbol]
- ) = {
- ks.apply.to[Seq].map(_.name)
- }
- def main(args: Array[String]): Unit = {
- val g = LabelledGeneric[Foo]
- println(f(g))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement