monad-gen-0.3.0.1: A simple monad for generating fresh integers

Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Monad.Gen

Synopsis

Documentation

data GenT e m a Source

The monad transformer for generating fresh values.

Instances

MonadError e m => MonadError e (GenT e' m) 
MonadReader r m => MonadReader r (GenT e m) 
MonadState s m => MonadState s (GenT e m) 
MonadWriter w m => MonadWriter w (GenT e m) 
Monad m => MonadGen e (GenT e m) 
MonadTrans (GenT e) 
(Monad m, Functor m, MonadPlus m) => Alternative (GenT e m) 
Monad m => Monad (GenT e m) 
Functor m => Functor (GenT e m) 
MonadFix m => MonadFix (GenT e m) 
MonadPlus m => MonadPlus (GenT e m) 
(Functor f, Monad f) => Applicative (GenT e f) 
MonadIO m => MonadIO (GenT e m) 
MonadCont m => MonadCont (GenT e m) 

type Gen e = GenT e Identity Source

successor :: (e -> e) -> Successor e Source

runGenT :: (Enum e, Monad m) => GenT e m a -> m a Source

Run a GenT computation starting from the value toEnum 0

runGen :: Enum e => Gen e a -> a Source

Run a Gen computation starting from the value toEnum 0

runGenTWith :: Monad m => Successor e -> e -> GenT e m a -> m a Source

Run a GenT computation starting from a specific value e with a the next fresh value determined by Successor e.

runGenWith :: Successor e -> e -> Gen e a -> a Source

Run a GenT computation starting from a specific value e with a the next fresh value determined by Successor e.

runGenTFrom :: (Monad m, Enum e) => e -> GenT e m a -> m a Source

Run a GenT computation starting from a specific value e.

runGenFrom :: Enum e => e -> Gen e a -> a Source

Run a Gen computation starting from a specific value e.