Backtracking, interleaving, and terminating Monad transformers (functional pearl)

Oleg Kiselyov, Chung Chieh Shan, Daniel P. Friedman, Amr Sabry

Research output: Chapter in Book/Report/Conference proceedingConference contribution

46 Citations (Scopus)

Abstract

We design and implement a library for adding backtracking computations to any Haskell monad. Inspired by logic programming, our library provides, in addition to the operations required by the MonadPlus interface, constructs for fair disjunctions, fair conjunctions, conditionals, pruning, and an expressive top-level interface. Implementing these additional constructs is easy in models of backtracking based on streams, but not known to be possible in continuation-based models. We show that all these additional constructs can be generically and monadically realized using a single primitive msplit. We present two implementations of the library: one using success and failure continuations; and the other using control operators for manipulating delimited continuations.

Original languageEnglish
Title of host publicationICFP 2005 - Proceedings of the 10th ACM SIGPLAN International Conference on Functional Programming
Pages192-203
Number of pages12
DOIs
Publication statusPublished - 2005 Dec 1
Externally publishedYes
Event10th ACM SIGPLAN International Conference on Functional Programming, ICFP 2005 - Tallinn, Estonia
Duration: 2005 Sep 262005 Sep 28

Publication series

NameProceedings of the ACM SIGPLAN International Conference on Functional Programming, ICFP

Other

Other10th ACM SIGPLAN International Conference on Functional Programming, ICFP 2005
CountryEstonia
CityTallinn
Period05/9/2605/9/28

Keywords

  • Continuations
  • Control delimiters
  • Haskell
  • Logic programming
  • Prolog
  • Streams

ASJC Scopus subject areas

  • Software

Fingerprint Dive into the research topics of 'Backtracking, interleaving, and terminating Monad transformers (functional pearl)'. Together they form a unique fingerprint.

Cite this