Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides facilities for generating unique names.
Synopsis
- data VNameSource
- blankNameSource :: VNameSource
- newNameSource :: Int -> VNameSource
- newName :: VNameSource -> VName -> (VName, VNameSource)
- newVName :: VNameSource -> String -> (VName, VNameSource)
- newVNameFromName :: VNameSource -> Name -> (VName, VNameSource)
Documentation
data VNameSource Source #
A name source is conceptually an infinite sequence of names with no repeating entries. In practice, when asked for a name, the name source will return the name along with a new name source, which should then be used in place of the original.
The Ord
instance is based on how many names have been extracted
from the name source.
Instances
blankNameSource :: VNameSource Source #
A blank name source.
newNameSource :: Int -> VNameSource Source #
A new name source that starts counting from the given number.
newName :: VNameSource -> VName -> (VName, VNameSource) Source #
Produce a fresh name, using the given name as a template.
newVName :: VNameSource -> String -> (VName, VNameSource) Source #
Produce a fresh VName
, using the given base name as a template.
newVNameFromName :: VNameSource -> Name -> (VName, VNameSource) Source #
Produce a fresh VName
, using the given base name as a template.