Skip to content

Instantly share code, notes, and snippets.

@pjazdzewski1990
Created February 25, 2016 09:01
Embed
What would you like to do?
import scala.language.experimental.macros
import scala.reflect.api.Trees
import scala.reflect.macros.blackbox
sealed trait Component {
def toTree(implicit c: blackbox.Context): c.Tree
def derive: Component
}
object Scalac {
private def extractComponents(tree: Trees#Tree)(implicit c: blackbox.Context): List[Component] = ???
def derivative(f: Double => Double): Double => Double = macro derivativeImpl
def derivativeImpl(c: blackbox.Context)
(f: c.Expr[Double => Double]): c.Expr[Double => Double] = ???
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment