projects
/
matthijs
/
master-project
/
cλash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rewrite substitute to clone the substitution range.
[matthijs/master-project/cλash.git]
/
cλash
/
CLasH
/
Normalize.hs
diff --git
a/cλash/CLasH/Normalize.hs
b/cλash/CLasH/Normalize.hs
index 1f0509da5a2ee674aae1117c9150615794152638..4ef112b605e762c16186f12951123a37574e060d 100644
(file)
--- a/
cλash/CLasH/Normalize.hs
+++ b/
cλash/CLasH/Normalize.hs
@@
-65,7
+65,7
@@
etatop = notappargs ("eta", eta)
--------------------------------
beta, betatop :: Transform
-- Substitute arg for x in expr
--------------------------------
beta, betatop :: Transform
-- Substitute arg for x in expr
-beta (App (Lam x expr) arg) =
change $ substitute [(x, arg)]
expr
+beta (App (Lam x expr) arg) =
setChanged >> substitute x arg
expr
-- Propagate the application into the let
beta (App (Let binds expr) arg) = change $ Let binds (App expr arg)
-- Propagate the application into each of the alternatives
-- Propagate the application into the let
beta (App (Let binds expr) arg) = change $ Let binds (App expr arg)
-- Propagate the application into each of the alternatives