| 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 #
The Fresh type class governs monads which can generate new
globally unique Names based on a given Name.
Instances
| Fresh m => Fresh (MaybeT m) # | |
| Monad m => Fresh (FreshMT m) # | |
| Fresh m => Fresh (FFM m) # | |
| Fresh m => Fresh (ExceptT e m) # | |
| (Error e, Fresh m) => Fresh (ErrorT e m) # | |
| Fresh m => Fresh (ReaderT r m) # | |
| Fresh m => Fresh (StateT s m) # | |
| Fresh m => Fresh (StateT s 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
runFreshMT :: Monad m => FreshMT m a -> m a #
Run a FreshMT computation (with the global index starting at zero).
contFreshMT :: Monad m => FreshMT m a -> Integer -> m a #
Run a FreshMT computation given a starting index for fresh name
generation.
contFreshM :: FreshM a -> Integer -> a #
Run a FreshM computation given a starting index.