Vergleich CPS-Interpreter/Transformator

Wiederholung CPS-Interpreter:

type Cont = Val -> Action Val
eval :: Env -> Exp -> Cont -> Action Val
eval env x = \ k -> case x of
    ConstInt i -> ... 
    Plus a b -> ...

CPS-Transformator:

type Cont = ExpValue -> Transform ExpCPS
cps :: Exp -> Cont -> Transform ExpCPS
cps x = \ m -> case x of
    ConstInt i -> ... 
    Plus a b -> ...



Johannes Waldmann 2014-03-31