Copyright | (c) Kimiyuki Onaka 2020 |
---|---|
License | Apache License 2.0 |
Maintainer | kimiyuki95@gmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- rename :: MonadAlpha m => VarName -> m VarName
- runExpr :: (MonadAlpha m, MonadError Error m) => [(VarName, VarName)] -> Expr -> m Expr
- runToplevelExpr :: (MonadAlpha m, MonadError Error m) => [(VarName, VarName)] -> ToplevelExpr -> m ToplevelExpr
- runProgram :: (MonadAlpha m, MonadError Error m) => Program -> m Program
- run :: (MonadAlpha m, MonadError Error m) => Program -> m Program
Documentation
runExpr :: (MonadAlpha m, MonadError Error m) => [(VarName, VarName)] -> Expr -> m Expr Source #
runToplevelExpr :: (MonadAlpha m, MonadError Error m) => [(VarName, VarName)] -> ToplevelExpr -> m ToplevelExpr Source #
runProgram :: (MonadAlpha m, MonadError Error m) => Program -> m Program Source #
run :: (MonadAlpha m, MonadError Error m) => Program -> m Program Source #
run
renames variables in exprs to avoid name conflictions, even if the scopes of two variables are distinct.
Examples
Before:
let x = 0 in y = x + x in x = x + y x + y
After:
let x0 = 0 in y1 = x0 + x0 in x2 = x0 + y1 x2 + y1