module Control.ContStuff.Simple
(
ChoiceT,
choice, findAll, findAll_, findFirst, findFirst_,
T.listA, listChoiceT, maybeChoiceT,
EitherT,
evalEitherT, testEitherT,
MaybeT,
evalMaybeT, testMaybeT,
ReaderT,
runReaderT,
StateT,
evalStateT, execStateT,
WriterT,
runWriterT, evalWriterT, execWriterT,
module Control.Applicative,
module Control.ContStuff.Classes,
module Control.Monad
)
where
import qualified Control.ContStuff.Trans as T
import Control.Applicative
import Control.ContStuff.Classes
import Control.ContStuff.Instances ()
import Control.ContStuff.Trans (ReaderT, runReaderT)
import Control.Monad
import Data.Monoid
type ChoiceT m a = forall r i. T.ChoiceT r i m a
choice :: [a] -> ChoiceT m a
choice xs = T.choice xs
findAll :: (Alternative f, Applicative m) => ChoiceT m a -> m (f a)
findAll c = T.findAll c
findAll_ :: Applicative m => ChoiceT m a -> m ()
findAll_ c = T.findAll_ c
findFirst :: (Alternative f, Applicative m) => ChoiceT m a -> m (f a)
findFirst c = T.findFirst c
findFirst_ :: Applicative m => ChoiceT m a -> m ()
findFirst_ c = T.findFirst_ c
listChoiceT :: Applicative m => ChoiceT m a -> m [a]
listChoiceT c = T.listChoiceT c
maybeChoiceT :: Applicative m => ChoiceT m a -> m (Maybe a)
maybeChoiceT c = T.maybeChoiceT c
type EitherT e m a = forall r. T.EitherT r e m a
evalEitherT :: Applicative m => EitherT e m a -> m (Either e a)
evalEitherT c = T.evalEitherT c
testEitherT :: Applicative m => EitherT e m a -> m Bool
testEitherT c = T.testEitherT c
type MaybeT m a = forall r. T.MaybeT r m a
evalMaybeT :: Applicative m => MaybeT m a -> m (Maybe a)
evalMaybeT c = T.evalMaybeT c
testMaybeT :: Applicative m => MaybeT m a -> m Bool
testMaybeT c = T.testMaybeT c
type StateT s m a = forall r. T.StateT r s m a
evalStateT :: Applicative m => s -> StateT s m a -> m a
evalStateT s0 c = T.evalStateT s0 c
execStateT :: Applicative m => s -> StateT s m a -> m s
execStateT s0 c = T.execStateT s0 c
type WriterT w m a = forall r. T.OldWriterT r w m a
runWriterT :: (Applicative m, Monoid w) => WriterT w m a -> m (a, w)
runWriterT c = T.runOldWriterT c
evalWriterT :: (Applicative m, Monoid w) => WriterT w m a -> m a
evalWriterT c = fmap fst . T.runOldWriterT $ c
execWriterT :: (Applicative m, Monoid w) => WriterT w m a -> m w
execWriterT c = fmap snd . T.runOldWriterT $ c