Created
January 21, 2016 20:42
-
-
Save cab/44ab75567912332d05d7 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 tester extends Poly1 { | |
implicit def hlistCase[T <: HList](implicit mapper : Mapper[tester.type, T]) = at[T](x => { | |
testMap(x) | |
}) | |
implicit def anyCase[T] = at[T](x => 1) | |
} | |
def testMap[T <: HList](t: T)(implicit mapper : Mapper[tester.type, T]) = t.map(tester) | |
val entities = (ComponentA() :: HNil) :: HNil | |
println(testMap(entities)) | |
/* | |
error: could not find implicit value for parameter mapper: shapeless.ops.hlist.Mapper[tester.type,shapeless.::[shapeless.::[ComponentA,shapeless.HNil],shapeless.HNil]] | |
at: println(testMap(entities)) | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment