Copyright | (c) Kimiyuki Onaka 2020 |
---|---|

License | Apache License 2.0 |

Maintainer | kimiyuki95@gmail.com |

Stability | experimental |

Portability | portable |

Safe Haskell | None |

Language | Haskell2010 |

`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 solve

to

let solve x = x in solve