Created
December 6, 2013 05:12
-
-
Save rrmckinley/7818919 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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