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

Safe HaskellSafe
LanguageHaskell2010

Control.Monad.LogicState.Class

Synopsis

Documentation

class (MonadLogic m, MonadState s m) => MonadLogicState s m where Source #

API for MonadLogic which allows state and backtracking on it.

Methods

backtrack :: m a -> m (m a) Source #

Return argument monad with the current backtrackable part of the state remembered. If the default def is not overridden this a no-op. This function complements mplus for LogicT, mplus backtracks on results, not on state, which is what this function should do.

Instances

Monad m => MonadLogicState (gs, bs) (LogicStateT gs bs m) Source # 

Methods

backtrack :: LogicStateT gs bs m a -> LogicStateT gs bs m (LogicStateT gs bs m a) Source #