FAQ Database Discussion Community


Scala Macro: Create new classes with Option types

scala,scala-macros,scala-2.11,scala-macro-paradise,scala-meta
I want to write a macro given this: @MetaRest case class User( @get id : Int, @get @post @patch name : String, @get @post email : String, registeredOn : DateTime ) Generate the following piece of code: object User { case class Get(id: Int, name: String, email: String) case class...

Scala recursive macro?

scala,scala-macros,lenses,scala-macro-paradise,scala-meta
I was wondering whether Scala supports recursive macro expansion e.g. I am trying to write a lens library with a lensing macro that does this: case class C(d: Int) case class B(c: C) case class A(b: B) val a = A(B(C(10)) val aa = lens(a)(_.b.c.d)(_ + 12) assert(aa.b.c.d == 22)...