Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Successor a = Successor {
- suc :: a -> a
- newtype FreshT e m a = FreshT {}
- type Fresh e = FreshT e Identity
- successor :: forall e. (e -> e) -> Successor e
- enumSucc :: forall e. Enum e => Successor e
- runFreshT :: forall e m a. (Enum e, Monad m) => FreshT e m a -> m a
- runFresh :: forall e a. Enum e => Fresh e a -> a
- runFreshTFrom :: forall e m a. (Monad m, Enum e) => e -> FreshT e m a -> m a
- runFreshFrom :: forall e a. Enum e => e -> Fresh e a -> a
- runFreshTWith :: forall e m a. Monad m => Successor e -> e -> FreshT e m a -> m a
- runFreshWith :: forall e a. Successor e -> e -> Fresh e a -> a
- class Monad m => MonadFresh e m | m -> e where
- fresh :: m e
Documentation
The monad transformer for generating fresh values.
Instances
runFreshT :: forall e m a. (Enum e, Monad m) => FreshT e m a -> m a Source #
Run a FreshT
computation starting from the value
toEnum 0
runFresh :: forall e a. Enum e => Fresh e a -> a Source #
Run a Fresh
computation starting from the value
toEnum 0
runFreshTFrom :: forall e m a. (Monad m, Enum e) => e -> FreshT e m a -> m a Source #
Run a FreshT
computation starting from a specific value e
.
runFreshFrom :: forall e a. Enum e => e -> Fresh e a -> a Source #
Run a Fresh
computation starting from a specific value e
.
runFreshTWith :: forall e m a. Monad m => Successor e -> e -> FreshT e m a -> m a Source #
Run a FreshT
computation starting from a specific value e
with
a the next fresh value determined by Successor e
.
runFreshWith :: forall e a. Successor e -> e -> Fresh e a -> a Source #
Run a FreshT
computation starting from a specific value e
with
a the next fresh value determined by Successor e
.
class Monad m => MonadFresh e m | m -> e where Source #
The MTL style class for generating fresh values
Generate a fresh value e
, fresh
should never produce the
same value within a monadic computation.
Instances
MonadFresh e m => MonadFresh e (MaybeT m) Source # | |
Defined in Control.Monad.Fresh | |
Monad m => MonadFresh e (FreshT e m) Source # | |
Defined in Control.Monad.Fresh | |
MonadFresh e m => MonadFresh e (ExceptT e' m) Source # | |
Defined in Control.Monad.Fresh | |
MonadFresh e m => MonadFresh e (IdentityT m) Source # | |
Defined in Control.Monad.Fresh | |
MonadFresh e m => MonadFresh e (ReaderT s m) Source # | |
Defined in Control.Monad.Fresh | |
MonadFresh e m => MonadFresh e (StateT s m) Source # | |
Defined in Control.Monad.Fresh | |
(MonadFresh e m, Monoid s) => MonadFresh e (WriterT s m) Source # | |
Defined in Control.Monad.Fresh | |
MonadFresh e m => MonadFresh e (ContT r m) Source # | |
Defined in Control.Monad.Fresh | |
(Monoid w, MonadFresh e m) => MonadFresh e (RWST r w s m) Source # | |
Defined in Control.Monad.Fresh |