TreeTransformScopeInstance

trait TreeTransformScopeInstance[F[_], T, C <: CpsMonadContext[F]](val cpsCtx: TransformationContext[F, T, C])(implicit evidence$4: Type[F], evidence$5: Type[T], evidence$6: Type[C], val qctx: Quotes) extends TreeTransformScope[F, T, C]
trait TreeTransformScope[F, T, C]
trait ValDefTreeTransform[F, T, C]
trait BlockTreeTransform[F, T, C]
trait InlinedTreeTransform[F, T, C]
trait RepeatedTreeTransform[F, T, C]
trait AsyncTreeShifter[F, T, C]
trait MatchTreeTransform[F, T, C]
trait LambdaTreeTransform[F, T, C]
trait SelectTreeTransform[F, T, C]
trait AwaitTreeTransform[F, T, C]
trait ApplicationHelper[F, T, C]
trait ApplyArgBuilderScope[F, T, C]
trait ApplyArgRecordScope[F, T, C]
trait ApplyTreeTransform[F, T, C]
trait RootTreeTransform[F, T, C]
trait TypeApplyTreeTransform[F, T, C]
trait KnownTreeFragments[F, T, C]
trait CpsTreeScope[F, T, C]
class Object
trait Matchable
class Any

Type members

Inherited classlikes

case class AppendCpsTree(frs: CpsTree, snd: CpsTree) extends CpsTree

append cps tree, which is frs and then snd. we use this representation instead Mapped/Flatmapped in cases, where we later can apply await to append term and simplify tree instead wrapping awaited tree in extra flatMap

append cps tree, which is frs and then snd. we use this representation instead Mapped/Flatmapped in cases, where we later can apply await to append term and simplify tree instead wrapping awaited tree in extra flatMap

Inherited from:
CpsTreeScope
case class ApplyArgByNameRecord(term: Term, index: Int, cpsTree: CpsTree, optShiftType: Option[ApplicationShiftType]) extends ApplyArgRecord
Inherited from:
ApplyArgRecordScope
case class ApplyArgLambdaRecord(term: Term, index: Int, cpsBody: CpsTree, optShiftType: Option[ApplicationShiftType], existsLambdaUnshift: Boolean) extends ApplyArgRecord
Inherited from:
ApplyArgRecordScope
case class ApplyArgNamedRecord(term: NamedArg, name: String, nested: ApplyArgRecord) extends ApplyArgRecord
Inherited from:
ApplyArgRecordScope
case class ApplyArgNoPrecalcTermRecord(term: Term, index: Int, isChanged: Boolean) extends ApplyArgRecord
Inherited from:
ApplyArgRecordScope
case class ApplyArgPrecalcTermRecord(term: Term, index: Int, termCpsTree: CpsTree, valDef: ValDef, ident: Term) extends ApplyArgRecord
Inherited from:
ApplyArgRecordScope
sealed trait ApplyArgRecord
Inherited from:
ApplyArgRecordScope
case class ApplyArgRepeatRecord(term: Repeated, index: Int, elements: List[ApplyArgRecord], seqTypeTree: TypeTree) extends ApplyArgRecord
Inherited from:
ApplyArgRecordScope
case class ApplyArgsSummaryProperties(step1: ApplyArgsSummaryPropertiesStep1, usePrepend: Boolean)
Inherited from:
ApplyArgRecordScope
case class ApplyArgsSummaryPropertiesStep1(hasAsync: Boolean, hasShiftedLambda: Boolean, shouldBeChangedSync: Boolean)
Inherited from:
ApplyArgRecordScope
sealed abstract class AsyncCpsTree extends CpsTree
Inherited from:
CpsTreeScope
case class AsyncLambdaCpsTree(originLambda: Term, params: List[ValDef], body: CpsTree, otpe: TypeRepr) extends CpsTree
Inherited from:
CpsTreeScope
case class AwaitAsyncCpsTree(nested: CpsTree, otpe: TypeRepr) extends AsyncCpsTree
Inherited from:
CpsTreeScope
case class AwaitSyncCpsTree(origin: Term, otpe: TypeRepr) extends AsyncCpsTree
Inherited from:
CpsTreeScope
object B2
Inherited from:
RootTreeTransform
case class BlockCpsTree(prevs: Queue[Statement], last: CpsTree) extends CpsTree
Inherited from:
CpsTreeScope
Inherited from:
CpsTreeScope
case class BuildApplyArgsAcc(posIndex: Int, paramIndex: Int, wasNamed: Boolean, inRepeat: Boolean, inNamed: Boolean, records: Seq[ApplyArgRecord], filledNamed: Set[Int])
Inherited from:
ApplyArgBuilderScope
case class CallChainSubstCpsTree(origin: Term, shifted: Term, otpe: TypeRepr) extends CpsTree

when we have swhifted function, which should return F[A] but we want to have in F[A] methods with special meaning, which should be performed on F[_] before jumping into monad (exampe: Iterable.withFilter) we will catch in ApplyTree such methods and substitute to appropriative calls of shifted.

when we have swhifted function, which should return F[A] but we want to have in F[A] methods with special meaning, which should be performed on F[_] before jumping into monad (exampe: Iterable.withFilter) we will catch in ApplyTree such methods and substitute to appropriative calls of shifted.

Inherited from:
CpsTreeScope
sealed abstract class CpsTree
Inherited from:
CpsTreeScope
object CpsTree
Inherited from:
CpsTreeScope
case object EmptyCpsTree extends CpsTree
Inherited from:
CpsTreeScope
case class FlatMappedCpsTree(prev: CpsTree, opm: Term => Term, otpe: TypeRepr) extends AsyncCpsTree
Inherited from:
CpsTreeScope
Inherited from:
InlinedTreeTransform
case class InlinedBindingsRecord(changes: HashMap[Symbol, InlinedBindingRecord], newBindings: List[Definition], awaitVals: List[ValDef])
Inherited from:
InlinedTreeTransform
case class InlinedCpsTree(origin: Inlined, bindings: List[Definition], nested: CpsTree) extends CpsTree
Inherited from:
CpsTreeScope
case class InlinedFunBindingRecord(newSym: Symbol, cpsTree: CpsTree, oldValDef: ValDef, newResultType: TypeRepr) extends InlinedBindingRecord
Inherited from:
InlinedTreeTransform
case class InlinedValBindingRecord(newSym: Symbol, cpsTree: CpsTree, oldValDef: ValDef) extends InlinedBindingRecord
Inherited from:
InlinedTreeTransform
case class MappedCpsTree(prev: CpsTree, op: Term => Term, otpe: TypeRepr) extends AsyncCpsTree
Inherited from:
CpsTreeScope
case class MessageWithPos(message: String, pos: Position)
Inherited from:
TreeTransformScope
object O
Inherited from:
ApplyArgBuilderScope
case class PartialShiftedApply(shiftType: ApplicationShiftType, shifted: Term)

Application with one list of params.

Application with one list of params.

Inherited from:
PartialShiftedApplyScope
case class PureCpsTree(origin: Statement, isChanged: Boolean) extends CpsTree
Inherited from:
CpsTreeScope
case class SelectTypeApplyCpsTree(origin: Option[Term], nested: CpsTree, targs: List[TypeTree], selects: List[SelectTypeApplyRecord], otpe: TypeRepr, changed: Boolean) extends CpsTree

represent select expression, which can be in monad or outside monad.

represent select expression, which can be in monad or outside monad.

constructor is not devoted to used directly: use SelectTypeApplyCpsTree.create instead. selects is reversed (i.e. external added to head)

Inherited from:
CpsTreeScope
case class SelectTypeApplyRecord(prevTpe: TypeRepr, symbol: Symbol, targs: List[TypeTree], level: Int)
Inherited from:
CpsTreeScope
case class ValCpsTree(valDef: ValDef, rightPart: CpsTree, nested: CpsTree, canBeLambda: Boolean) extends CpsTree
Inherited from:
CpsTreeScope

Value members

Inherited methods

def adoptContextInMyAwait(awaitTerm: Term, arg: Term, monadContext: Term): Term
Inherited from:
AwaitTreeTransform
def asyncShift(t: Term, shiftedSymbols: Set[Symbol]): Term
Inherited from:
AsyncTreeShifter
def asyncShiftCaseDef(cd: CaseDef, shiftedSymbols: Set[Symbol]): CaseDef
Inherited from:
AsyncTreeShifter
def asyncShiftDefinition(t: Definition, shiftedSymbols: Set[Symbol]): Definition
Inherited from:
AsyncTreeShifter
def asyncShiftStatement(t: Statement, shiftedSymbols: Set[Symbol]): Statement
Inherited from:
AsyncTreeShifter
def blockBuildAwaitValueDiscard(discardTerm: Term, p: Term): Term
Inherited from:
BlockTreeTransform
def blockCheckValueDiscarded(t: Term): Boolean
Inherited from:
BlockTreeTransform
def buildApply(cpsFun: CpsTree, fun: Term, argRecords: Seq[ApplyArgRecord], applyTerm: Apply, argsProperties: ApplyArgsSummaryProperties, inShiftedCallChain: Boolean, tails: List[Seq[ApplyArgRecord]]): CpsTree
Inherited from:
ApplyTreeTransform
def buildShiftedApply(cpsFun: CpsTree, fun: Term, argRecords: Seq[ApplyArgRecord], withAsync: Boolean, tails: List[Seq[ApplyArgRecord]], applyTerm: Apply): CpsTree
Inherited from:
ApplyTreeTransform
def checkLambdaDef(term: Term): Option[Term]
Inherited from:
InlinedTreeTransform
def cpsShiftedMethodType(paramNames: List[String], paramTypes: List[TypeRepr], otpe: TypeRepr): MethodType

method type for (p1 ... pn) => F[otpe]

method type for (p1 ... pn) => F[otpe]

Inherited from:
LambdaTreeTransform
def exprToTree[T](expr: CpsExpr[F, T], e: Term): CpsTree
Inherited from:
RootTreeTransform
def findAsyncShiftTerm(e: Term): (ImplicitSearchResult, TypeRepr)
Inherited from:
ApplyTreeTransform
def generateAwaitFor(term: Term, tpe: TypeRepr): Term
Inherited from:
InlinedTreeTransform
def handleArgs1(applyTerm: Apply, fun: Term, cpsFun: CpsTree, args: List[Term], tails: List[Seq[ApplyArgRecord]], 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)

Value parameters:
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.
Inherited from:
ApplyTreeTransform
def handleFun(applyTerm: Apply, fun: Term, args: List[Term], tails: List[Seq[ApplyArgRecord]]): CpsTree
Inherited from:
ApplyTreeTransform
def handleFunApply(applyTerm: Apply, fun: Term, args: List[Term], fun1: Term, args1: List[Term], tails: List[Seq[ApplyArgRecord]]): CpsTree
Inherited from:
ApplyTreeTransform
def handleFunIdent(applyTerm: Apply, fun: Term, args: List[Term], name: String, tails: List[Seq[ApplyArgRecord]]): CpsTree
Inherited from:
ApplyTreeTransform
def handleFunSelect(applyTerm: Apply, fun: Term, args: List[Term], obj: Term, methodName: String, tails: List[Seq[ApplyArgRecord]]): CpsTree
Inherited from:
ApplyTreeTransform
def handleFunTypeApply(applyTerm: Apply, fun: Term, args: List[Term], obj: Term, targs: List[TypeTree], tails: List[Seq[ApplyArgRecord]]): CpsTree

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

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

Inherited from:
ApplyTreeTransform
def isInMonad(tpe: TypeRepr): Boolean
Inherited from:
TreeTransformScope
def posExpr(t: Term): Expr[Any]
Inherited from:
TreeTransformScope
def posExprs(terms: Term*): Expr[Any]
Inherited from:
TreeTransformScope
def runApply(applyTerm: Apply, fun: Term, args: List[Term], tails: List[Seq[ApplyArgRecord]]): CpsTree

case Apply(fun,args) transform application

case Apply(fun,args) transform application

tails -- list of prepared sequence of curried arguments.

Inherited from:
ApplyTreeTransform
def runAwait(term: Term, arg: Term, awaitCpsMonadType: TypeRepr, awaitCpsMonad: Term, awaitCpsMonadContext: Term): CpsTree
Inherited from:
AwaitTreeTransform
def runBlock(block: Block, prevs: List[Statement], last: Term): CpsTree
Inherited from:
BlockTreeTransform
def runInlined(origin: Inlined): CpsTree
Inherited from:
InlinedTreeTransform
def runLambda(lambdaTerm: Term, params: List[ValDef], expr: Term): CpsTree
Inherited from:
LambdaTreeTransform
def runMatch(matchTerm: Match): CpsTree
Inherited from:
MatchTreeTransform
def runMyAwait(awaitTerm: Term, arg: Term, context: Term): CpsTree
Inherited from:
AwaitTreeTransform
def runOtherAwait(awaitTerm: Term, arg: Term, targ: TypeRepr, otherCpsMonad: Term, myMonadContext: Term): CpsTree
Inherited from:
AwaitTreeTransform
def runRepeated(repeated: Term, elements: List[Term], tpt: TypeTree): CpsTree
Inherited from:
RepeatedTreeTransform
def runRoot(term: Term, muted: Boolean): CpsTree
Inherited from:
RootTreeTransform
def runRootUneta(term: Term, muted: Boolean): CpsTree
Inherited from:
RootTreeTransform
def runSelect(selectTerm: Select): CpsTree
Inherited from:
SelectTreeTransform
def runSelectOuter(term: SelectOuter): CpsTree
def runTypeApply(applyTerm: Term, fun: Term, targs: List[TypeTree]): CpsTree
Inherited from:
TypeApplyTreeTransform
def runValDefFromBlock(block: Block, valDef: ValDef): CpsTree
Inherited from:
ValDefTreeTransform
def safeShow(t: Tree): String
Inherited from:
TreeTransformScope
def safeTypeShow(tp: TypeRepr): String
Inherited from:
TreeTransformScope
def sameSelect(funTerm: Term, name: String, targs: List[TypeTree], args: List[Term]): Option[Term]
Inherited from:
ApplyTreeTransform
def shiftedApplyCps(funCpsTree: CpsTree, argRecords: Seq[ApplyArgRecord], argTails: List[Seq[ApplyArgRecord]], applyTerm: Term, withAsync: Boolean): CpsTree
Inherited from:
ApplyTreeTransform
def shiftedApplyTerm(funTerm: Term, argRecords: Seq[ApplyArgRecord], withAsync: Boolean): PartialShiftedApply
Inherited from:
ApplyTreeTransform
def shiftedLambdaType(tpe: TypeRepr): TypeRepr
Inherited from:
ApplyTreeTransform
def shiftedLambdaTypeTree(tpt: TypeTree): TypeTree
Inherited from:
ApplyTreeTransform
def shiftedResultCpsTree(origin: Term, shifted: Term): CpsTree
Inherited from:
ApplyTreeTransform
def termIsNoOrderDepended(x: Term): Boolean
Inherited from:
ApplyArgRecordScope
def unitTerm: Literal
Inherited from:
TreeTransformScope
def valDefApplyMemoization(valDef: ValDef, cpsRhs: CpsTree, rhs: Term): CpsTree
Inherited from:
ValDefTreeTransform
def withInlineBindings(origin: Inlined, tree: CpsTree): CpsTree
Inherited from:
ApplyTreeTransform

Concrete fields

override val cpsCtx: TransformationContext[F, T, C]

Inherited fields

lazy val awaitPure: Term
Inherited from:
KnownTreeFragments
lazy val awaitSymbol: Symbol
Inherited from:
KnownTreeFragments
lazy val flatMapSymbol: Symbol
Inherited from:
KnownTreeFragments
lazy val mapSymbol: Symbol
Inherited from:
KnownTreeFragments
lazy val monadTypeTree: TypeTree
Inherited from:
KnownTreeFragments
lazy val objAsyncShift: TypeRepr
Inherited from:
KnownTreeFragments
lazy val partialFunctionType: TypeRepr
Inherited from:
KnownTreeFragments
lazy val pureSymbol: Symbol
Inherited from:
KnownTreeFragments

Extensions

Inherited extensions

extension (otherCake: TreeTransformScope[_[_], _, _])
def adopt(t: Term): Term
Inherited from:
CpsTreeScope
def adoptStatement(t: Statement): Statement
Inherited from:
CpsTreeScope
def adoptTerm(t: Term): Term
Inherited from:
CpsTreeScope
def adoptTermFun(op: Term => Term): Term => Term
Inherited from:
CpsTreeScope
def adoptType(t: TypeRepr): TypeRepr
Inherited from:
CpsTreeScope

Implicits

Implicits

implicit override val qctx: Quotes

Inherited implicits

implicit val ccType: Type[C]
Inherited from:
TreeTransformScope
implicit val ctType: Type[T]
Inherited from:
TreeTransformScope
implicit val fType: Type[F]
Inherited from:
TreeTransformScope