BRICS; Department of Computer Science; University of Aarhus
SVM HeaderParse 0.2
Ny Munkegade, DK-8000 Aarhus C, Denmark
SVM HeaderParse 0.1
There has already been considerable research on constructing modular, monad-based specications of computational eects (state, exceptions, nondeterminism, etc.) in programming languages. We present a simple framework in this tradition, based on a Church-style eect-typing system for an ML-like language. The semantics of this language is formally dened by a series of monadic translations, each one expanding away a layer of eects. Such a layered specication is easy to reason about, but its direct implementation (whether by parameterized interpretation or by actual translation) is often prohibitively ineÆcient. By exploiting deeper semantic properties of monads, however, it is also possible to derive a vastly more eÆcient implementation: we show that each layer of eects can be uniformly simulated by continuation-passing, and further that multiple such layers can themselves be simulated by a standard semantics for call/cc and mutable state. Thus, even multi-eect programs can be execu...
user correction - Legacy Corrections
Proceedings of the Twenty-Sixth Annual ACM Symposium on Principles of Programming Languages