contstuff-1.0.1: Fast, easy to use CPS-based monad transformers

Stabilityexperimental
MaintainerErtugrul Soeylemez <es@ertes.de>

Control.ContStuff.Simple

Contents

Description

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

Synopsis

Choice/nondeterminism

type ChoiceT m a = forall r i. ChoiceT r i m aSource

choice :: [a] -> ChoiceT m aSource

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

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

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

Turn a list into a computation with alternatives.

Exceptions

type EitherT e m a = forall r. EitherT r e m aSource

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

type MaybeT m a = forall r. MaybeT r m aSource

State

type StateT s m a = forall r. StateT r s m aSource

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