hermit-0.1.1.0: Haskell Equational Reasoning Model-to-Implementation Tunnel

Safe HaskellSafe-Infered

Language.HERMIT.Primitive.AlphaConversion

Synopsis

Documentation

shadowedNamesQuery :: TranslateH CoreExpr StringSource

Output a list of all variables that shadowed by bindings in the is expression.

renameIdR :: (Injection a Core, Generic a ~ Core) => Id -> Id -> RewriteH aSource

Arguments are the original identifier and the replacement identifier, respectively.

replaceId :: Id -> Id -> Id -> IdSource

Given an identifier to replace, and a replacement, produce an Id -> Id function that acts as in identity for all Ids except the one to replace, for which it returns the replacment. Don't export this, it'll likely just cause confusion.

alphaLam :: Maybe Name -> RewriteH CoreExprSource

Alpha rename a lambda binder. Optionally takes a suggested new name.

alphaCaseBinder :: Maybe Name -> RewriteH CoreExprSource

Alpha rename a case binder. Optionally takes a suggested new name.

alphaAltId :: Maybe Name -> Id -> RewriteH CoreAltSource

Rename the specified identifier in a case alternative. Optionally takes a suggested new name.

alphaAlt :: RewriteH CoreAltSource

Rename all identifiers bound in a case alternative.

alphaCase :: RewriteH CoreExprSource

Rename all identifiers bound in a case expression.

alphaLetNonRec :: Maybe Name -> RewriteH CoreExprSource

Alpha rename a non-recursive let binder. Optionally takes a suggested new name.

alphaLetRecId :: Maybe Name -> Id -> RewriteH CoreExprSource

Rename the specified identifier bound in a recursive let. Optionally takes a suggested new name.

alphaLetRec :: RewriteH CoreExprSource

Rename all identifiers bound in a recursive let.

alphaLetRecOne :: Maybe Name -> RewriteH CoreExprSource

Rename the identifier bound in a recursive let with a single recursively bound identifier. Optionally takes a suggested new name.

alphaLetOne :: Maybe Name -> RewriteH CoreExprSource

Rename the identifier bound in a let with a single bound identifier. Optionally takes a suggested new name.

alphaLet :: RewriteH CoreExprSource

Rename all identifiers bound in a Let.

alphaConsNonRec :: Maybe Name -> RewriteH CoreProgramSource

Alpha rename a non-recursive top-level binder. Optionally takes a suggested new name.

alphaConsRecId :: Maybe Name -> Id -> RewriteH CoreProgramSource

Rename the specified identifier bound in a recursive top-level binder. Optionally takes a suggested new name.

alphaConsRec :: RewriteH CoreProgramSource

Rename all identifiers bound in a recursive top-level binder.

alphaConsRecOne :: Maybe Name -> RewriteH CoreProgramSource

Rename the identifier bound in a recursive top-level binder with a single recursively bound identifier. Optionally takes a suggested new name.

alphaConsOne :: Maybe Name -> RewriteH CoreProgramSource

Rename the identifier bound in a top-level binder with a single bound identifier. Optionally takes a suggested new name.

alphaCons :: RewriteH CoreProgramSource

Rename all identifiers bound in a Let.

alpha :: RewriteH CoreSource

Alpha rename any bindings at this node. Note: does not rename case alternatives unless invoked on the alternative.