Created
January 2, 2015 00:48
-
-
Save alexarchambault/7d3c744a25c36ac8e60a to your computer and use it in GitHub Desktop.
LabelledGeneric, scala 2.10 (2)
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
case class Foo0() | |
case class Foo1(i: Int) | |
object Lgen2 { | |
import shapeless._ | |
import language.experimental.macros | |
// Works with this one, but hard to do anything with it then... | |
implicit def lgen[T]: shapeless.LabelledGeneric[T] = macro shapeless.GenericMacros.materializeLabelled[T, Nothing] | |
// Does *not* work with this one | |
// implicit def lgen[T, R]: shapeless.LabelledGeneric.Aux[T, R] = macro shapeless.GenericMacros.materializeLabelled[T, R] | |
LabelledGeneric[Foo0] | |
LabelledGeneric[Foo1] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment