TY - GEN
T1 - Backtracking, interleaving, and terminating Monad transformers (functional pearl)
AU - Kiselyov, Oleg
AU - Shan, Chung Chieh
AU - Friedman, Daniel P.
AU - Sabry, Amr
PY - 2005/12/1
Y1 - 2005/12/1
N2 - 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.
AB - 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.
KW - Continuations
KW - Control delimiters
KW - Haskell
KW - Logic programming
KW - Prolog
KW - Streams
UR - http://www.scopus.com/inward/record.url?scp=33746031730&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=33746031730&partnerID=8YFLogxK
U2 - 10.1145/1086365.1086390
DO - 10.1145/1086365.1086390
M3 - Conference contribution
AN - SCOPUS:33746031730
SN - 1595930647
SN - 9781595930644
T3 - Proceedings of the ACM SIGPLAN International Conference on Functional Programming, ICFP
SP - 192
EP - 203
BT - ICFP 2005 - Proceedings of the 10th ACM SIGPLAN International Conference on Functional Programming
T2 - 10th ACM SIGPLAN International Conference on Functional Programming, ICFP 2005
Y2 - 26 September 2005 through 28 September 2005
ER -