logict-state-0.1.0.2: Library for logic programming based on haskell package logict

Safe HaskellSafe
LanguageHaskell2010

Control.Monad.TransLogicState.Class

Synopsis

Documentation

class TransLogicState s t where Source

Additions to MonadTrans specifically useful for LogicState

Minimal complete definition

liftWithState

Methods

observeT :: Monad m => s -> t m a -> m a Source

Extracts the first result from a 't m' computation, failing otherwise.

observeAllT :: Monad m => s -> t m a -> m [a] Source

Extracts all results from a 't m' computation.

observeManyT :: forall m a. Monad m => s -> Int -> t m a -> m [a] Source

Extracts up to a given number of results from a 't m' computation.

liftWithState :: Monad m => (s -> m (a, s)) -> t m a Source

Lift a monad by threading the state available in the transformed monad through it

Instances

observe :: TransLogicState s t => s -> t Identity a -> a Source

Extracts the first result from a LogicVar computation.

observeAll :: TransLogicState s t => s -> t Identity a -> [a] Source

Extracts all results from a LogicVar computation.

observeMany :: TransLogicState s t => s -> Int -> t Identity a -> [a] Source

Extracts up to a given number of results from a LogicVar computation.