Skip to content

Instantly share code, notes, and snippets.

@rrmckinley
Created December 6, 2013 05:12
Show Gist options
  • Save rrmckinley/7818919 to your computer and use it in GitHub Desktop.
Save rrmckinley/7818919 to your computer and use it in GitHub Desktop.
object Reckeys {
import shapeless.{ HList, HNil, Id }, shapeless.Poly1, shapeless.record.FieldType, shapeless.ops.hlist.{ Mapper, Tupler }, shapeless.syntax.singleton._;
object recordKeys extends Poly1 {
implicit def caseAll[K, V] = at[FieldType[K, V]](ft => ??? : K)
}
def reckeys[L <: HList, P <: HList](ev: L)(implicit m: Mapper.Aux[recordKeys.type, L, P],
t: Tupler[P]): t.type { type Out = t.Out } = t
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment