Stability | experimental |
---|---|

Maintainer | Ertugrul Soeylemez <es@ertes.de> |

This module provides all the transformers from Control.ContStuff.Trans, but with a simplified interface, hiding the underlying CPS machinery.

- type ChoiceT m a = forall r i. ChoiceT r i m a
- choice :: [a] -> ChoiceT m a
- findAll :: (Alternative f, Applicative m) => ChoiceT m a -> m (f a)
- findAll_ :: Applicative m => ChoiceT m a -> m ()
- findFirst :: (Alternative f, Applicative m) => ChoiceT m a -> m (f a)
- findFirst_ :: Applicative m => ChoiceT m a -> m ()
- listA :: Alternative f => [a] -> f a
- listChoiceT :: Applicative m => ChoiceT m a -> m [a]
- maybeChoiceT :: Applicative m => ChoiceT m a -> m (Maybe a)
- type EitherT e m a = forall r. EitherT r e m a
- evalEitherT :: Applicative m => EitherT e m a -> m (Either e a)
- testEitherT :: Applicative m => EitherT e m a -> m Bool
- type MaybeT m a = forall r. MaybeT r m a
- evalMaybeT :: Applicative m => MaybeT m a -> m (Maybe a)
- testMaybeT :: Applicative m => MaybeT m a -> m Bool
- data ReaderT e m a
- runReaderT :: Applicative m => e -> ReaderT e m a -> m a
- type StateT s m a = forall r. StateT r s m a
- evalStateT :: Applicative m => s -> StateT s m a -> m a
- execStateT :: Applicative m => s -> StateT s m a -> m s
- type WriterT w m a = forall r. OldWriterT r w m a
- runWriterT :: (Applicative m, Monoid w) => WriterT w m a -> m (a, w)
- evalWriterT :: (Applicative m, Monoid w) => WriterT w m a -> m a
- execWriterT :: (Applicative m, Monoid w) => WriterT w m a -> m w
- module Control.Applicative
- module Control.ContStuff.Classes
- module Control.Monad

# Choice/nondeterminism

findAll :: (Alternative f, Applicative m) => ChoiceT m a -> m (f a)Source

findAll_ :: Applicative m => ChoiceT m a -> m ()Source

findFirst :: (Alternative f, Applicative m) => ChoiceT m a -> m (f a)Source

findFirst_ :: Applicative m => ChoiceT m a -> m ()Source

listA :: Alternative f => [a] -> f aSource

Turn a list into a computation with alternatives.

listChoiceT :: Applicative m => ChoiceT m a -> m [a]Source

maybeChoiceT :: Applicative m => ChoiceT m a -> m (Maybe a)Source

# Exceptions

evalEitherT :: Applicative m => EitherT e m a -> m (Either e a)Source

testEitherT :: Applicative m => EitherT e m a -> m BoolSource

evalMaybeT :: Applicative m => MaybeT m a -> m (Maybe a)Source

testMaybeT :: Applicative m => MaybeT m a -> m BoolSource

# Reader

Monad transformer for computations with readable environment. Unlike the other monad transformers this one allows no CPS effects and also hides its constructors, which makes it commutative.

If you need CPS effects, consider using `StateT`

.

runReaderT :: Applicative m => e -> ReaderT e m a -> m aSource

Run a computation with environment.

# State

evalStateT :: Applicative m => s -> StateT s m a -> m aSource

execStateT :: Applicative m => s -> StateT s m a -> m sSource

# Writer

type WriterT w m a = forall r. OldWriterT r w m aSource

runWriterT :: (Applicative m, Monoid w) => WriterT w m a -> m (a, w)Source

evalWriterT :: (Applicative m, Monoid w) => WriterT w m a -> m aSource

execWriterT :: (Applicative m, Monoid w) => WriterT w m a -> m wSource

# Reexports

module Control.Applicative

module Control.ContStuff.Classes

module Control.Monad