ApplyTreeTransform

trait ApplyTreeTransform[F[_], CT]
Companion
object
class Object
trait Matchable
class Any

Value members

Concrete methods

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

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)

Value Params
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>`]]): `<none>`
def handleFunApply(applyTerm: `<none>`, fun: `<none>`, args: List[`<none>`], fun1: `<none>`, args1: List[`<none>`], tails: List[Seq[`<none>`]]): `<none>`
def handleFunIdent(applyTerm: `<none>`, fun: `<none>`, args: List[`<none>`], name: String, tails: List[Seq[`<none>`]]): `<none>`
def handleFunSelect(applyTerm: `<none>`, fun: `<none>`, args: List[`<none>`], obj: `<none>`, methodName: String, tails: List[Seq[`<none>`]]): `<none>`
def handleFunTypeApply(applyTerm: `<none>`, fun: `<none>`, args: List[`<none>`], obj: `<none>`, targs: List[`<none>`], tails: List[Seq[`<none>`]]): `<none>`

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

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

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

case Apply(fun,args) transform application

case Apply(fun,args) transform application

tails -- list of prepared sequence of curried arguments.

def sameSelect(funTerm: `<none>`, name: String, targs: List[`<none>`], args: List[`<none>`]): Option[`<none>`]
def shiftedApplyCps(cpsTree: `<none>`, originArgs: List[`<none>`], shiftedArgs: List[`<none>`], shiftedIndexes: Set[Int], shiftedTails: List[List[`<none>`]], applyTerm: `<none>`): `<none>`
def shiftedApplyTerm(term: `<none>`, originArgs: List[`<none>`], shiftedArgs: List[`<none>`], shiftedIndexes: Set[Int]): `<none>`
def shiftedLambdaType(tpe: `<none>`): `<none>`
def shiftedLambdaTypeTree(tpt: `<none>`): `<none>`
def shiftedResultCpsTree(origin: `<none>`, shifted: `<none>`): `<none>`