Skip to content

Instantly share code, notes, and snippets.

Created February 25, 2016 09:01
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