CpsTransformHelper

cps.plugin.CpsTransformHelper

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def adoptResultTypeParam(targs: List[Type], fType: Type)(using Context): List[Type]

([T1,...Tn,R] tranfrom to [T1,...Tn,CpsType[F,R]]

([T1,...Tn,R] tranfrom to [T1,...Tn,CpsType[F,R]]

Value parameters

targs
  • type arguments of origin context function,

Attributes

def asyncKindFromTransformedType(tpe: Type, ft: Type)(using Context): AsyncKind
def cpsDirectAliasSymbol(using Context): TypeSymbol
def cpsMonadContextClassSymbol(using Context): ClassSymbol
def cpsTransformedErasedType(t: Type, fType: Type)(using Context): Type
def cpsTransformedType(t: Type, fType: Type, debug: Boolean)(using Context): Type

CpsType[F[_],T] = F[T] is T is not function type (X1..Xn) => CpsType[F, Y] if T = (X1...Xn) => Y

CpsType[F[_],T] = F[T] is T is not function type (X1..Xn) => CpsType[F, Y] if T = (X1...Xn) => Y

Attributes

def extractMonadType(contextFunctionArgType: Type, wrapperSymbol: Symbol, pos: SrcPos)(using Context): Type

Extract monad type from context function type. TODO: Type-lambda monads case, now we think that this is F[_].

Extract monad type from context function type. TODO: Type-lambda monads case, now we think that this is F[_].

Value parameters

contextFunctionArgType

is CpsDirect[F] or CpsMonadContext[F]

wrapperSymbol:

naked symbol of wrapper. i.e. requiredClass("cps.CpsDirect") or requiredClass("cps.CpsMonadContext")

Attributes

Returns

F

def extractReturnType(tpe: Type)(using Context): Type
def findCpsThrowSupport(monadType: Type, span: Span)(using ctx: Context): Option[Tree]
def findCpsTrySupport(monadType: Type, span: Span)(using ctx: Context): Option[Tree]
def findImplicitInstance(tpe: Type, span: Span)(using ctx: Context): Option[Tree]
def findRuntimeAwait(monadType: Type, span: Span)(using ctx: Context): Option[Tree]
def findRuntimeAwaitProvider(monadType: Type, span: Span)(using ctx: Context): Option[Tree]
def findWrapperForMonad(wrapperClassName: String, monadType: Type, span: Span)(using Context): Option[Tree]
def isCpsDirectSymbol(sym: Symbol)(using Context): Boolean
def isCpsDirectType(tpe: Type, debug: Boolean)(using Context): Boolean

Check that type is CpsDirect[F]. Note, that this function should be called before erasure. After erasure the encoding is different

Check that type is CpsDirect[F]. Note, that this function should be called before erasure. After erasure the encoding is different

Attributes

def transformContextualLambdaType(lambdaTree: Tree, params: List[ValDef], body: Tree, fType: Type)(using Context): MethodType

Transform method type of function (...params) ?=> T to (...params) ?=> Cps[F,T]

Transform method type of function (...params) ?=> T to (...params) ?=> Cps[F,T]

Value parameters

body
  • function boldy
fType
  • type of F[_]
lambdaTree
  • origin function
params
  • list of parameters of lambda function

Attributes

Returns

params ?=> F[T]