| Monad transformers and modular interpreters |
| Full text |
Pdf
(1.10 MB)
|
| Source
|
Annual Symposium on Principles of Programming Languages
archive
Proceedings of the 22nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
table of contents
San Francisco, California, United States
Pages: 333 - 343
Year of Publication: 1995
ISBN:0-89791-692-1
|
|
Authors
|
|
Sheng Liang
|
Yale University, Department of Computer Science, New Haven, CT
|
|
Paul Hudak
|
Yale University, Department of Computer Science, New Haven, CT
|
|
Mark Jones
|
Department of Computer science, University of Nottingham, University Park, Nottingham NG7 2RD, England and Yale University, Department of Computer Science, New Haven, CT
|
|
| Sponsors |
|
| Publisher |
|
| Bibliometrics |
Downloads (6 Weeks): 10, Downloads (12 Months): 70, Citation Count: 48
|
|
|
ABSTRACT
We show how a set of building blocks can be used to construct programming language interpreters, and present implementations of such building blocks capable of supporting many commonly known features, including simple expressions, three different function call mechanisms (call-by-name, call-by-value and lazy evaluation), references and assignment, nondeterminism, first-class continuations, and program tracing.The underlying mechanism of our system is monad transformers, a simple form of abstraction for introducing a wide range of computational behaviors, such as state, I/O, continuations, and exceptions.Our work is significant in the following respects. First, we have succeeded in designing a fully modular interpreter based on monad transformers that incudes features missing from Steele's, Espinosa's, and Wadler's earlier efforts. Second, we have found new ways to lift monad operations through monad transformers, in particular difficult cases not achieved in Moggi's original work. Third, we have demonstrated that interactions between features are reflected in liftings and that semantics can be changed by reordering monad transformers. Finally, we have implemented our interpreter in Gofer, whose constructor classes provide just the added power over Haskell's type classes to allow precise and convenient expression of our ideas. This implementation includes a method for constructing extensible unions and a form of subtyping that is interesting in its own right.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
 |
1
|
A. W. Appel , T. Jim, Continuation-passing, closure-passing style, Proceedings of the 16th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.293-302, January 11-13, 1989, Austin, Texas, United States
[doi> 10.1145/75277.75303]
|
| |
2
|
Adrienne Bloss, Paul HudaK and Jonathan Young. Code optimization for lazy evaluation. Lisp and Symbolic Computation, 1(1):147-164,1988.
|
| |
3
|
|
| |
4
|
David Espinosa. Modular denotational semantics. Unpublished manuscript, December 1993.
|
| |
5
|
David Espinosa. Building interpreters by transforming stratified monads. Unpublished manuscript, ftp from altdorf.ai.mit.edu:pub/dae, June 1994.
|
 |
6
|
|
 |
7
|
Paul Hudak , Simon Peyton Jones , Philip Wadler , Brian Boutel , Jon Fairbairn , Joseph Fasel , María M. Guzmán , Kevin Hammond , John Hughes , Thomas Johnsson , Dick Kieburtz , Rishiyur Nikhil , Will Partain , John Peterson, Report on the programming language Haskell: a non-strict, purely functional language version 1.2, ACM SIGPLAN Notices, v.27 n.5, p.1-164, May 1992
[doi> 10.1145/130697.130699]
|
| |
8
|
Mark P. Jones. Introduction to gofer 2.20. Ftp from nebula.cs.yale.e#lu in the directory pub/haskell/gofer, September 19911.
|
 |
9
|
|
| |
10
|
Mark P. Jones #nd Luc Duponcheel Composing monads. Research Report- YALEU/DCS/RR-1004, Yale University Departrhent of Computer Science, New Haven, Connecticut, December 1993.
|
 |
11
|
|
 |
12
|
Amir Kishon , Paul Hudak , Charles Consel, Monitoring semantics: a formal framework for specifying, implementing, and reasoning about execution monitors, Proceedings of the ACM SIGPLAN 1991 conference on Programming language design and implementation, p.338-352, June 24-28, 1991, Toronto, Ontario, Canada
|
| |
13
|
|
| |
14
|
|
| |
15
|
Eugenio Mogg#. An abstract view of programming languages. Techni/:al Report ECS-LFCS-90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, Edinburgh, Scotland, 1990.
|
| |
16
|
|
 |
17
|
|
 |
18
|
|
| |
19
|
|
 |
20
|
|
 |
21
|
|
 |
22
|
|
 |
23
|
|
CITED BY 48
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Albert Cohen , Sébastien Donadio , Maria-Jesus Garzaran , Christoph Herrmann , Oleg Kiselyov , David Padua, In search of a program generator to implement generic transformations for high-performance computing, Science of Computer Programming, v.62 n.1, p.25-46, September 2006
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Paul Hudak , John Hughes , Simon Peyton Jones , Philip Wadler, A history of Haskell: being lazy with class, Proceedings of the third ACM SIGPLAN conference on History of programming languages, p.12-1-12-55, June 09-10, 2007, San Diego, California
|
Peer to Peer - Readers of this Article have also read:
-
Data structures for quadtree approximation and compression
Communications of the ACM
28, 9
Hanan Samet
-
A hierarchical single-key-lock access control using the Chinese remainder theorem
Proceedings of the 1992 ACM/SIGAPP Symposium on Applied computing
Kim S. Lee
, Huizhu Lu
, D. D. Fisher
-
The GemStone object database management system
Communications of the ACM
34, 10
Paul Butterworth
, Allen Otis
, Jacob Stein
-
Putting innovation to work: adoption strategies for multimedia communication systems
Communications of the ACM
34, 12
Ellen Francik
, Susan Ehrlich Rudman
, Donna Cooper
, Stephen Levine
-
An intelligent component database for behavioral synthesis
Proceedings of the 27th ACM/IEEE conference on Design automation
Gwo-Dong Chen
, Daniel D. Gajski
|