fresh-0.1.1: Introduce fresh variables into Haskell source code




In the context of this library, a fresh variable has the form:

 Ident "@foo"

where Ident is a constructor of the Name type from Language.Haskell.Exts, and "foo" is the variable's name. A concrete variable is any other variable that appears in the source code.

To concretize a fresh variable means to remove the '@' character that appears before its name and to rename the variable (keeping its existing name as a prefix) so that it is globally unique across an AST.



concretize :: Data a => a -> aSource

Concretize all of the fresh variables appearing in the given Data value (most likely a Haskell AST).

concretize' :: Data a => a -> (a, ConflictTable)Source

Same as concretize, but returns the ConflictTable used for concretization.

type ConflictTable = Map String StringSource

Maps fresh variables with conflicting names to unique names that are non-conflicting.