monad-gen-0.2.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) 
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

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 => e -> GenT e m a -> m a Source

Run a GenT computation starting from a specific value e.

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

Run a Gen computation starting from a specific value e.