Browse > Article

Development of an Assembly Language Interpreter Using Monad  

Byun, Sug-Woo (경성대학교 컴퓨터학부)
Abstract
Monad in Haskell allows one to do imperative-style programming as well as pure functional programming. In this work, we characterize monadic abstraction and its programming technique by restructuring an assembly language interpreter coded in pure functional style into the one by the monadic style. Monad programming consists of two phases; the State monad is applied to a stack and a symbol table, and then a State Monad Transformer integrating these two monads is constructed. As a result, we can see that the program code by monad programming is much clearer and more intuitive than one written in the pure functional style.
Keywords
Haskell; Monad; Monad Transformer; State Monad; State Monad Transformer;
Citations & Related Records
연도 인용수 순위
  • Reference
1 Sheng Liang, Paul Hudak, and Mark P. Jones, Monad transformers and modular interpreters. In POPL, pp.333-343, 1995.
2 Sheng Liang, Modular Monadic Semantics and Compilation, PhD thesis, Yale University, 1997.
3 David Espinosa, Building interpreters by transforming stratified monads, 1994.
4 Guy L. Steele Jr, Building interpreters by composing monads, In POPL '94, January 1994.
5 Paul Hudak, Modular Domain Specific Languages and Tools, Proceedings of Fifth International Conference on Software Reuse, IEEE Computer Society Press, 1998.
6 Mark P. Jones. Functional programming with overloading and higher-order polymorphism. In Advanced Functional Programming, pp.97-136, 1995.
7 Alfred V. Aho, Monica S. Lam, Ravi Sethi, and Jeffrey D. Ullman, Compilers: Principles, Techniques, and Tools, Pearson Education, 1986.
8 Bryan O'Sullivan, Don Stewart, and John Goerzen, Real World Haskell, O'Reilly Media, 2008.
9 Haskell Homepage. http://haskell.org.
10 MTL (Monad Transformer Library). Control.Moad.
11 Simon Thompson. Haskell: The Craft of Functional Programming, Addison Wesley, 1999.
12 Eugin Moggi. Computational lambda-calculus and monads. In IEEE Symposium on Logic in Computer Science, June 1989.
13 Philip Wadler. Comprehending Monads. In Proceedings of the 1990 ACM Conference on Lisp and Functional Programming Languages, 1990.
14 Graham Hutton. Programming in Haskell, Cambridge University Press, 2007.