Safe Haskell | None |
---|
- class Monad m => NameMonad n m | m -> n where
- addNames :: [n] -> m ()
- addBoundNames :: [n] -> m ()
- newName :: m n
- newNameFrom :: [n] -> m n
- uniqueName :: n -> m n
- class GenName n where
- data NameMT n m a
- runNameMT :: Monad m => NameMT a1 m a -> m a
- runNameMT' :: Monad m => NameMT a1 m a -> m (a, Set a1)
- freeNames :: (Ord n, GenName n) => Set n -> [n]
- mixInt :: Int -> Int -> Int
- mixInt3 :: Int -> Int -> Int -> Int
- hashInt :: Int -> Int
Documentation
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.
Add to list of used names
addBoundNames :: [n] -> m ()Source
Add to list of bound names
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
Generating names.
Name monad transformer.
runNameMT' :: Monad m => NameMT a1 m a -> m (a, Set a1)Source