License  BSDlike (see LICENSE) 

Maintainer  Brent Yorgey <byorgey@cis.upenn.edu> 
Stability  experimental 
Portability  unportable (GHC 7 only) 
Safe Haskell  None 
Language  Haskell2010 
Synopsis
 class Monad m => Fresh m where
 type FreshM = FreshMT Identity
 runFreshM :: FreshM a > a
 contFreshM :: FreshM a > Integer > a
 newtype FreshMT m a = FreshMT {}
 runFreshMT :: Monad m => FreshMT m a > m a
 contFreshMT :: Monad m => FreshMT m a > Integer > m a
 class Monad m => LFresh m where
 type LFreshM = LFreshMT Identity
 runLFreshM :: LFreshM a > a
 contLFreshM :: LFreshM a > Set AnyName > a
 newtype LFreshMT m a = LFreshMT {
 unLFreshMT :: ReaderT (Set AnyName) m a
 runLFreshMT :: LFreshMT m a > m a
 contLFreshMT :: LFreshMT m a > Set AnyName > m a
The
Fresh
class
class Monad m => Fresh m where Source #
The Fresh
type class governs monads which can generate new
globally unique Name
s based on a given Name
.
fresh :: Rep a => Name a > m (Name a) Source #
Generate a new globally unique name based on the given one.
Instances
Fresh m => Fresh (ListT m) Source #  
Fresh m => Fresh (MaybeT m) Source #  
Monad m => Fresh (FreshMT m) Source #  
Fresh m => Fresh (IdentityT m) Source #  
Fresh m => Fresh (ExceptT e m) Source #  
Fresh m => Fresh (StateT s m) Source #  
Fresh m => Fresh (StateT s m) Source #  
(Monoid w, Fresh m) => Fresh (WriterT w m) Source #  
(Monoid w, Fresh m) => Fresh (WriterT w m) Source #  
Fresh m => Fresh (ContT r m) Source #  
Fresh m => Fresh (ReaderT r m) Source #  
runFreshM :: FreshM a > a Source #
Run a FreshM computation (with the global index starting at zero).
contFreshM :: FreshM a > Integer > a Source #
Run a FreshM computation given a starting index.
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 Source #  
Defined in Unbound.LocallyNameless.Fresh  
MonadWriter w m => MonadWriter w (FreshMT m) Source #  
MonadState s m => MonadState s (FreshMT m) Source #  
MonadReader r m => MonadReader r (FreshMT m) Source #  
MonadError e m => MonadError e (FreshMT m) Source #  
Defined in Unbound.LocallyNameless.Fresh throwError :: e > FreshMT m a # catchError :: FreshMT m a > (e > FreshMT m a) > FreshMT m a #  
Monad m => Monad (FreshMT m) Source #  
Functor m => Functor (FreshMT m) Source #  
MonadFix m => MonadFix (FreshMT m) Source #  
Defined in Unbound.LocallyNameless.Fresh  
Monad m => Applicative (FreshMT m) Source #  
MonadIO m => MonadIO (FreshMT m) Source #  
Defined in Unbound.LocallyNameless.Fresh  
MonadPlus m => Alternative (FreshMT m) Source #  
MonadPlus m => MonadPlus (FreshMT m) Source #  
MonadCont m => MonadCont (FreshMT m) Source #  
Monad m => Fresh (FreshMT m) Source #  
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.
The
LFresh
class
class Monad m => LFresh m where Source #
This is the class of monads that support freshness in an (implicit) local scope. Generated names are fresh for the current local scope, not necessarily globally fresh.
lfresh :: Rep a => Name a > m (Name a) Source #
Pick a new name that is fresh for the current (implicit) scope.
avoid :: [AnyName] > m a > m a Source #
Avoid the given names when freshening in the subcomputation, that is, add the given names to the inscope set.
getAvoids :: m (Set AnyName) Source #
Get the set of names currently being avoided.
Instances
LFresh m => LFresh (ListT m) Source #  
LFresh m => LFresh (MaybeT m) Source #  
Monad m => LFresh (LFreshMT m) Source #  
LFresh m => LFresh (IdentityT m) Source #  
LFresh m => LFresh (ExceptT e m) Source #  
LFresh m => LFresh (StateT s m) Source #  
LFresh m => LFresh (StateT s m) Source #  
(Monoid w, LFresh m) => LFresh (WriterT w m) Source #  
(Monoid w, LFresh m) => LFresh (WriterT w m) Source #  
LFresh m => LFresh (ContT r m) Source #  
LFresh m => LFresh (ReaderT r m) Source #  
type LFreshM = LFreshMT Identity Source #
A convenient monad which is an instance of LFresh
. It keeps
track of a set of names to avoid, and when asked for a fresh one
will choose the first unused numerical name.
runLFreshM :: LFreshM a > a Source #
Run a LFreshM computation in an empty context.
contLFreshM :: LFreshM a > Set AnyName > a Source #
Run a LFreshM computation given a set of names to avoid.
The LFresh monad transformer. Keeps track of a set of names to avoid, and when asked for a fresh one will choose the first numeric prefix of the given name which is currently unused.
LFreshMT  

Instances
MonadTrans LFreshMT Source #  
Defined in Unbound.LocallyNameless.Fresh  
MonadWriter w m => MonadWriter w (LFreshMT m) Source #  
MonadState s m => MonadState s (LFreshMT m) Source #  
MonadReader r m => MonadReader r (LFreshMT m) Source #  
MonadError e m => MonadError e (LFreshMT m) Source #  
Defined in Unbound.LocallyNameless.Fresh throwError :: e > LFreshMT m a # catchError :: LFreshMT m a > (e > LFreshMT m a) > LFreshMT m a #  
Monad m => Monad (LFreshMT m) Source #  
Functor m => Functor (LFreshMT m) Source #  
MonadFix m => MonadFix (LFreshMT m) Source #  
Defined in Unbound.LocallyNameless.Fresh  
Applicative m => Applicative (LFreshMT m) Source #  
Defined in Unbound.LocallyNameless.Fresh  
MonadIO m => MonadIO (LFreshMT m) Source #  
Defined in Unbound.LocallyNameless.Fresh  
Alternative m => Alternative (LFreshMT m) Source #  
MonadPlus m => MonadPlus (LFreshMT m) Source #  
MonadCont m => MonadCont (LFreshMT m) Source #  
Monad m => LFresh (LFreshMT m) Source #  
runLFreshMT :: LFreshMT m a > m a Source #
Run an LFreshMT
computation in an empty context.