| Copyright | (c) 2014, Aleksey Kliger |
|---|---|
| License | BSD3 (See LICENSE) |
| Maintainer | Aleksey Kliger |
| Stability | experimental |
| Safe Haskell | None |
| Language | Haskell2010 |
Unbound.Generics.LocallyNameless.Fresh
Description
Global freshness monad.
Documentation
class Monad m => Fresh m where Source
The Fresh type class governs monads which can generate new
globally unique Names based on a given Name.
Methods
fresh :: Name a -> m (Name a) Source
Generate a new globally unique name based on the given one.
Instances
| Fresh m => Fresh (MaybeT m) | |
| Monad m => Fresh (FreshMT m) | |
| Fresh m => Fresh (ReaderT r m) | |
| Fresh m => Fresh (StateT s m) | |
| Fresh m => Fresh (StateT s m) | |
| Fresh m => Fresh (ExceptT e m) | |
| (Error e, Fresh m) => Fresh (ErrorT e m) | |
| (Monoid w, Fresh m) => Fresh (WriterT w m) | |
| (Monoid w, Fresh m) => Fresh (WriterT w m) |
The FreshM monad transformer. Keeps track of the lowest index
still globally unused, and increments the index every time it is
asked for a fresh name.
Instances
| MonadTrans FreshMT | |
| MonadError e m => MonadError e (FreshMT m) | |
| MonadReader r m => MonadReader r (FreshMT m) | |
| MonadState s m => MonadState s (FreshMT m) | |
| MonadWriter w m => MonadWriter w (FreshMT m) | |
| (Functor m, MonadPlus m) => Alternative (FreshMT m) | |
| Monad m => Monad (FreshMT m) | |
| Functor m => Functor (FreshMT m) | |
| MonadFix m => MonadFix (FreshMT m) | |
| MonadPlus m => MonadPlus (FreshMT m) | |
| (Monad m, Functor m) => Applicative (FreshMT m) | |
| MonadIO m => MonadIO (FreshMT m) | |
| MonadCont m => MonadCont (FreshMT m) | |
| Monad m => Fresh (FreshMT m) |
runFreshMT :: Monad m => FreshMT m a -> m a Source
Run a FreshMT computation (with the global index starting at zero).
contFreshMT :: Monad m => FreshMT m a -> Integer -> m a Source
Run a FreshMT computation given a starting index for fresh name
generation.
contFreshM :: FreshM a -> Integer -> a Source
Run a FreshM computation given a starting index.