| Copyright | (c) Kimiyuki Onaka 2020 |
|---|---|
| License | Apache License 2.0 |
| Maintainer | kimiyuki95@gmail.com |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Jikka.Core.Convert.RemoveUnusedVars
Description
RemoveUnusedVars remove unused variables from exprs.
Documentation
run :: MonadError Error m => Program -> m Program Source #
run removes unused variables in given programs.
This also removes variables for recursion, i.e. "rec" flags.
ToplevelLetRec may becomes ToplevelLet.
For example, this converts
let rec solve x =
let y = 0
in x
in solveto
let solve x =
x
in solve