ApplyTreeTransform

cps.macros.forest.ApplyTreeTransform
See theApplyTreeTransform companion object
trait ApplyTreeTransform[F[_], CT, CC <: CpsMonadContext[F]]

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait TreeTransformScope[F, CT, CC]
Self type

Members list

Concise view

Value members

Concrete methods

def buildApply(cpsFun: <none>, fun: <none>, argRecords: Seq[<none>], applyTerm: <none>, argsProperties: <none>, inShiftedCallChain: Boolean, tails: List[Seq[<none>]]): CpsTree
def buildShiftedApply(cpsFun: <none>, fun: <none>, argRecords: Seq[<none>], withAsync: Boolean, tails: List[Seq[<none>]], applyTerm: <none>): CpsTree
def findAsyncShiftTerm(e: <none>): (ImplicitSearchResult, TypeRepr)
def handleArgs1(applyTerm: <none>, fun: <none>, cpsFun: <none>, args: List[<none>], tails: List[Seq[<none>]], unpure: Boolean): CpsTree

How to handle arguments? We want keep evaluation order from left to right, so, imagine we have function f(a1,a2,a3) and a2 is async, a1, a3 - sync. we will transform this to

How to handle arguments? We want keep evaluation order from left to right, so, imagine we have function f(a1,a2,a3) and a2 is async, a1, a3 - sync. we will transform this to

{ val arg1 = a1;
  transform(a2).flatMap( x =>
     { val arg2 = x;
       val arg3 = a3;
       f(arg1, arg2, arg3)
}    }

more generally we at first generate block: { arg1 = a1; ..... argN = aN; f(arg1,...argN) } and then transform one, knowing that all arguments to f are sync (of course, if all arguments are sync, we just call f(arg1,... arg2) without all this machinery)

Attributes

applyTerm

= Apply(fun, args) - origin apply

args
  • first argument list
fun
  • function to apply (with type-paerameters)
tails
  • next argument lists if any
unpure
  • if true, that this is call from shifted substitution, which is already return F[_] by design.
def handleFun(applyTerm: <none>, fun: <none>, args: List[<none>], tails: List[Seq[<none>]]): CpsTree
def handleFunApply(applyTerm: <none>, fun: <none>, args: List[<none>], fun1: <none>, args1: List[<none>], tails: List[Seq[<none>]]): CpsTree
def handleFunIdent(applyTerm: <none>, fun: <none>, args: List[<none>], name: String, tails: List[Seq[<none>]]): CpsTree
def handleFunSelect(applyTerm: <none>, fun: <none>, args: List[<none>], obj: <none>, methodName: String, tails: List[Seq[<none>]]): CpsTree
def handleFunTypeApply(applyTerm: <none>, fun: <none>, args: List[<none>], obj: <none>, targs: List[<none>], tails: List[Seq[<none>]]): CpsTree

applyTerm = Apply(fun, args) fun = TypeApply(obj,targs)

applyTerm = Apply(fun, args) fun = TypeApply(obj,targs)

Attributes

def runApply(applyTerm: <none>, fun: <none>, args: List[<none>], tails: List[Seq[<none>]]): CpsTree

case Apply(fun,args) transform application

case Apply(fun,args) transform application

tails -- list of prepared sequence of curried arguments.

Attributes

def sameSelect(funTerm: <none>, name: String, targs: List[<none>], args: List[<none>]): Option[Term]
def shiftedApplyCps(funCpsTree: <none>, argRecords: Seq[<none>], argTails: List[Seq[<none>]], applyTerm: <none>, withAsync: Boolean): CpsTree
def shiftedApplyTerm(funTerm: <none>, argRecords: Seq[<none>], withAsync: Boolean): PartialShiftedApply
def shiftedLambdaType(tpe: <none>): TypeRepr
def shiftedLambdaTypeTree(tpt: <none>): TypeTree
def shiftedResultCpsTree(origin: <none>, shifted: <none>): CpsTree
def withInlineBindings(origin: <none>, tree: <none>): CpsTree