A monadic interpreter and type-and-effect checker
Abstract
We present a concrete implementation in Haskell of a monadic framework that includes both a small-step interpreter and a type-and-effect checker for the corresponding language. Our approach separates the language syntax from the semantics of its effects. This design allows the interpreter to remain parametric over the underlying monad, while the static checker approximates effects independently of their concrete implementation. The theoretical foundation of this framework-applied to a call-by-value lambda calculus with generic effects represented by operations that produce monadic values and are managed through handlers-was introduced in previous work, where the focus was on proving the soundness of the approach. In contrast, the present work leverages Haskell's support for modular programming and monads to demonstrate that the framework is practically implementable and usable. We illustrate the approach with examples using the monad of exceptions and the one of nondeterminism and expressions both with and without handlers.
Create a lesson
Related papers
A Type-and-Effect System for Temporal Dependency Analysis of Render-based Reactive Programs
Shared title terminologycs.PLJune Wunder, Ankush Das, Marco Gaboardi
Statically Typed Purely Functional Definitional Interpreters for {\it Essentials of Programming Languages}
Shared title terminologycs.PLKwanghoon Choi
On the Expressiveness of Asynchronous Processes with Nested Session Types
Shared title terminologycs.PLSjors Wortelboer, Dan Frumin, Jorge A. Pérez
Equality Saturation as an Abstract Interpretation
Shared title terminologycs.PLRussel Arbore, Alvin Cheung, Max Willsey
A View from the Bridge: Detecting Boundary Type Errors in Native Extensions of Dynamic Languages
Shared title terminologycs.PLThodoris Sotiropoulos, Georgios Alexopoulos, Dimitris Mitropoulos
Verifying Type Soundness for Nontransitive Information Flow Security
Shared title terminologycs.PLChenyi Zhang