ajhc- Haskell compiler that produce binary through C language

Safe HaskellNone




class Monad m => NameMonad n m | m -> n whereSource

There are bound names and used names, the used names are always a superset of the bound names. used names will not be chosen for any new bindings, bound names should be renamed if encountered.


addNames :: [n] -> m ()Source

Add to list of used names

addBoundNames :: [n] -> m ()Source

Add to list of bound names

newName :: m nSource

Choose a new name, adding it to both bound and used sets.

newNameFrom :: [n] -> m nSource

choose the first available name from list

uniqueName :: n -> m nSource

choose a new name if n is bound, else return n adding n to the bound names list


(Monad m, Monad (t m), MonadTrans t, NameMonad n m) => NameMonad n (t m) 
Monad m => NameMonad Id (IdNameT m) 
(GenName n, Ord n, Monad m) => NameMonad n (NameMT n m) 

class GenName n whereSource

Generating names.


genNames :: Int -> [n]Source

Generate a list of candidate names given a seed

data NameMT n m a Source

Name monad transformer.


(GenName n, Ord n, Monad m) => NameMonad n (NameMT n m) 
MonadTrans (NameMT n) 
Monad m => Monad (NameMT n m) 
Functor m => Functor (NameMT n m) 
MonadFix m => MonadFix (NameMT n m) 
MonadPlus m => MonadPlus (NameMT n m) 
MonadIO m => MonadIO (NameMT n m) 

runNameMT :: Monad m => NameMT a1 m a -> m aSource

Run the name monad transformer.

runNameMT' :: Monad m => NameMT a1 m a -> m (a, Set a1)Source

freeNames :: (Ord n, GenName n) => Set n -> [n]Source

Generate an infinite list of names not present in the given set.