Skip to content

Instantly share code, notes, and snippets.

@alexarchambault
Created January 2, 2015 00:48
Show Gist options
  • Save alexarchambault/7d3c744a25c36ac8e60a to your computer and use it in GitHub Desktop.
Save alexarchambault/7d3c744a25c36ac8e60a to your computer and use it in GitHub Desktop.
LabelledGeneric, scala 2.10 (2)
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