Deriving backtracking monad transformers
- 1 September 2000
- journal article
- Published by Association for Computing Machinery (ACM) in ACM SIGPLAN Notices
- Vol. 35 (9) , 186-197
- https://doi.org/10.1145/357766.351258
Abstract
In a paper about pretty printing J. Hughes introduced two fundamental techniques for deriving programs from their specification, where a specification consists of a signature and properties that the operations of the signature are required to satisfy. Briefly, the first technique, the term implementation, represents the operations by terms and works by defining a mapping from operations to observations --- this mapping can be seen as defining a simple interpreter. The second, the context-passing implementation, represents operations as functions from their calling context to observations. We apply both techniques to derive a backtracking monad transformer that adds backtracking to an arbitrary monad. In addition to the usual backtracking operations --- failure and nondeterministic choice --- the prolog cut and an operation for delimiting the effect of a cut are supported.Keywords
This publication has 7 references indexed in Scilit:
- Monad transformers and modular interpretersPublished by Association for Computing Machinery (ACM) ,1995
- The design of a pretty-printing libraryPublished by Springer Nature ,1995
- The essence of functional programmingPublished by Association for Computing Machinery (ACM) ,1992
- Notions of computation and monadsInformation and Computation, 1991
- Comprehending monadsPublished by Association for Computing Machinery (ACM) ,1990
- Simple operational and denotational semantics for Prolog with cutTheoretical Computer Science, 1990
- Rewrite SystemsPublished by Elsevier ,1990