Skip to content

Instantly share code, notes, and snippets.

@SethTisue
Created November 15, 2017 23:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SethTisue/4bd5f2e8c2f9d11031c93f259937eeb3 to your computer and use it in GitHub Desktop.
Save SethTisue/4bd5f2e8c2f9d11031c93f259937eeb3 to your computer and use it in GitHub Desktop.
NodePrinters
Welcome to Scala 2.12.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_131).
Type in expressions for evaluation. Or try :help.
scala> :power
Power mode enabled. :phase is at typer.
import scala.tools.nsc._, intp.global._, definitions._
Try :help or completions for vals._ and power._
scala> println(nodePrinters.nodeToString(reify { List(1, 2, 3).map(_ * 2) }.tree))
Apply(
Apply(
List.apply(1, 2, 3)."map"
Function(
ValDef(
<param> <synthetic>
"x$1"
<tpt>
<empty>
)
Apply(
"x$1"."$times"
2
)
)
)
"List"."canBuildFrom"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment