Copyright | (c) Kimiyuki Onaka 2021 |
---|---|
License | Apache License 2.0 |
Maintainer | kimiyuki95@gmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- run :: (MonadAlpha m, MonadError Error m) => Program -> m Program
- rule :: MonadAlpha m => RewriteRule m
Documentation
run :: (MonadAlpha m, MonadError Error m) => Program -> m Program Source #
run
moves let-exprs in lambdas passed to higher-order functions to the outer of the higher-order functions.
Examples
Before:
map (fun x -> let c = 12345 in c * x) xs
After:
let c = 12345 in map (fun x -> c * x) xs
internal rules
rule :: MonadAlpha m => RewriteRule m Source #