Efficient monadic-style backtracking (1996)
| Citations: | 2 - 2 self |
BibTeX
@TECHREPORT{Hinze96efficientmonadic-style,
author = {Ralf Hinze},
title = {Efficient monadic-style backtracking},
institution = {},
year = {1996}
}
OpenURL
Abstract
Lists are ubiquitous in functional programming. The list constructor forms an instance of a monad capturing non-deterministic computations. Despite its popularity the list monad suffers from serious drawbacks: It relies in an essential way on lazy evaluation, it is inefficient, and it is not modular. We develop an alternative based on continuations, which remedies these shortcomings. Essential use is made of constructor classes and second-order types, which sets the work apart from other approaches. Continuation-based backtracking monads behave amazingly well in practice: If an optimizing compiler is used, their performance is commensurate to that of logic languages. The class mechanism greatly eases the task of adding features to the basic machinery. We study three extensions in detail: control







