logict-0.2.3: A backtracking logic-programming monad.Source codeContentsIndex
Control.Monad.Logic
Portabilitynon-portable (multi-parameter type classes)
Stabilityexperimental
Maintainerdan.doel@gmail.com
Contents
The Logic monad
The LogicT monad transformer
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
module Control.Monad.Logic.Class
data Logic a
runLogic :: Logic a -> (a -> r -> r) -> r -> r
observe :: Logic a -> a
observeMany :: Int -> Logic a -> [a]
observeAll :: Logic a -> [a]
data LogicT m a
runLogicT :: LogicT m a -> (a -> m r -> m r) -> m r -> m r
observeT :: Monad m => LogicT m a -> m a
observeManyT :: Monad m => Int -> LogicT m a -> m [a]
observeAllT :: Monad m => LogicT m a -> m [a]
Documentation
module Control.Monad.Logic.Class
The Logic monad
data Logic a Source
The basic Logic monad, for performing backtracking computations returning values of type a
show/hide Instances
runLogic :: Logic a -> (a -> r -> r) -> r -> rSource
Runs a Logic computation with the specified initial success and failure continuations.
observe :: Logic a -> aSource
Extracts the first result from a Logic computation.
observeMany :: Int -> Logic a -> [a]Source
Extracts up to a given number of results from a Logic computation.
observeAll :: Logic a -> [a]Source
Extracts all results from a Logic computation.
The LogicT monad transformer
data LogicT m a Source
A monad transformer for performing backtracking computations layered over another monad m
show/hide Instances
runLogicT :: LogicT m a -> (a -> m r -> m r) -> m r -> m rSource
Runs a LogicT computation with the specified initial success and failure continuations.
observeT :: Monad m => LogicT m a -> m aSource
Extracts the first result from a LogicT computation, failing otherwise.
observeManyT :: Monad m => Int -> LogicT m a -> m [a]Source
Extracts up to a given number of results from a LogicT computation.
observeAllT :: Monad m => LogicT m a -> m [a]Source
Extracts all results from a LogicT computation.
Produced by Haddock version 2.3.0