{-# LANGUAGE FunctionalDependencies #-}
module Control.Monad.LogicState.Class
( MonadLogicState(..)
)
where
import Control.Monad
import Control.Monad.Logic.Class (MonadLogic)
import Control.Monad.State (MonadState)
class (MonadLogic m, Monad ms, MonadState (f gs bs) m) => MonadLogicState f gs bs ms m | m -> ms where
backtrackWithRoll
:: (gs -> bs -> bs -> ms bs)
-> m a
-> m (m a)
backtrackWithRoll gs -> bs -> bs -> ms bs
_ = forall (f :: * -> * -> *) gs bs (ms :: * -> *) (m :: * -> *) a.
MonadLogicState f gs bs ms m =>
m a -> m (m a)
backtrack
backtrack :: m a -> m (m a)
backtrack = forall (f :: * -> * -> *) gs bs (ms :: * -> *) (m :: * -> *) a.
MonadLogicState f gs bs ms m =>
(gs -> bs -> bs -> ms bs) -> m a -> m (m a)
backtrackWithRoll (\gs
_ bs
_ bs
bs -> forall (m :: * -> *) a. Monad m => a -> m a
return bs
bs)