mc2exp :: Cont -> Transform ExpCPS
mc2exp k = do
e <- fresh "e" ; out <- k (Ref e)
return $ MultiAbs [e] out
Anwendung:
App f a -> \ k ->
cps f $ \ f' ->
cps a $ \ a' -> do -- Ansatz:
x <- mc2exp k;return $ MultiApp f'[a',x]
tatsächlich statt Ansatz:
fresh_let ( mc2exp k ) $ \ x ->
return $ MultiApp f' [ a', x ]