| logict-0.2.2: A backtracking logic-programming monad. | Contents | Index |
|
Control.Monad.Logic | Portability | non-portable (multi-parameter type classes) | Stability | experimental | Maintainer | dan.doel@gmail.com |
|
|
|
|
|
Description |
A backtracking, logic programming monad.
Adapted from the paper
Backtracking, Interleaving, and Terminating
Monad Transformers, by
Oleg Kiselyov, Chung-chieh Shan, Daniel P. Friedman, Amr Sabry
(http://www.cs.rutgers.edu/~ccshan/logicprog/LogicT-icfp2005.pdf).
|
|
Synopsis |
|
|
|
Documentation |
|
module Control.Monad.Logic.Class |
|
The Logic monad
|
|
data Logic a |
The basic Logic monad, for performing backtracking computations
returning values of type a
| Instances | |
|
|
runLogic :: Logic a -> (a -> r -> r) -> r -> r |
Runs a Logic computation with the specified initial success and
failure continuations.
|
|
observe :: Logic a -> a |
Extracts the first result from a Logic computation.
|
|
observeMany :: Int -> Logic a -> [a] |
Extracts up to a given number of results from a Logic computation.
|
|
observeAll :: Logic a -> [a] |
Extracts all results from a Logic computation.
|
|
The LogicT monad transformer
|
|
data LogicT m a |
A monad transformer for performing backtracking computations
layered over another monad m
| Instances | |
|
|
runLogicT :: LogicT m a -> (a -> m r -> m r) -> m r -> m r |
Runs a LogicT computation with the specified initial success and
failure continuations.
|
|
observeT :: Monad m => LogicT m a -> m a |
Extracts the first result from a LogicT computation,
failing otherwise.
|
|
observeManyT :: Monad m => Int -> LogicT m a -> m [a] |
Extracts up to a given number of results from a LogicT computation.
|
|
observeAllT :: Monad m => LogicT m a -> m [a] |
Extracts all results from a LogicT computation.
|
|
module Control.Monad |
|
module Control.Monad.Trans |
|
Produced by Haddock version 0.8 |