Data structures and program transformation
Science of Computer Programming
The essence of functional programming
POPL '92 Proceedings of the 19th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Monad transformers and modular interpreters
POPL '95 Proceedings of the 22nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
First-class polymorphism with type inference
Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Writing Composable Software with InterpreterLib
SC '09 Proceedings of the 8th International Conference on Software Composition
Hi-index | 0.00 |
We present an integration of modular monadic semantics and generic programming concepts that facilitates the modular development of interpreters. Using modular monadic semantics, the computational structure is obtained as the composition of several monad transformers where each monad transformer adds a new notion of computation. Using generic programming, it is possible to divide the recursive structure of the abstract syntax in several non-recursive pattern functors. For each functor F, it is possible to define an F-algebra over the computational structure. In this way, an interpreter is automatically obtained as a catamorphism.In this paper we show that it is also possible to use monadic catamorphisms and to combine them with catamorphisms allowing the separation between recursive evaluation from semantic specification. As an example, we define the modular specification of a simple functional programming language with imperative features.