Safe Haskell | None |
---|---|
Language | Haskell98 |
Here, a standard semantic for the language defined in CPSScheme is implemented, following the definitions in Olin Shivers' "Control-Flow Analysis of Higher-Order Languages".
Types
A contour is an identifier for the contours (or dynamic frames) generated at each call of a lambda expression
type VEnv = (Var :× Contour) :⇀ D Source
A variable environment maps variable names together with a contour to a value. The second parameter is required to allow for different, shadowed bindings of the same variable to coexist.
A semantical value can either be
Evaluation functions
evalCPS evaluates a whole program, by initializing the envirnoments and passing the Stop continuation to the outermost lambda
evalV :: Val -> BEnv -> VEnv -> D Source
evalC (called A by Shivers) evaluates a syntactical value to a semantical piece of data.