Rewrite substitute to clone the substitution range.
[matthijs/master-project/cλash.git] / cλash / CLasH / Normalize.hs
index 1f0509da5a2ee674aae1117c9150615794152638..4ef112b605e762c16186f12951123a37574e060d 100644 (file)
@@ -65,7 +65,7 @@ etatop = notappargs ("eta", eta)
 --------------------------------
 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