[commit: ghc] master: Use mapAccumL (refactoring only) (48f17f1)
git at git.haskell.org
git at git.haskell.org
Fri Sep 19 11:30:42 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/48f17f156c3bb608603575ade2788140fadab192/ghc
>---------------------------------------------------------------
commit 48f17f156c3bb608603575ade2788140fadab192
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Tue Sep 9 12:57:04 2014 +0100
Use mapAccumL (refactoring only)
Fixes Trac #9529
>---------------------------------------------------------------
48f17f156c3bb608603575ade2788140fadab192
compiler/simplCore/CSE.lhs | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/compiler/simplCore/CSE.lhs b/compiler/simplCore/CSE.lhs
index 740aa5f..289388a 100644
--- a/compiler/simplCore/CSE.lhs
+++ b/compiler/simplCore/CSE.lhs
@@ -153,14 +153,7 @@ let-binding, and we can use cseRhs for dealing with the scrutinee.
\begin{code}
cseProgram :: CoreProgram -> CoreProgram
-cseProgram binds = cseBinds emptyCSEnv binds
-
-cseBinds :: CSEnv -> [CoreBind] -> [CoreBind]
-cseBinds _ [] = []
-cseBinds env (b:bs) = (b':bs')
- where
- (env1, b') = cseBind env b
- bs' = cseBinds env1 bs
+cseProgram binds = snd (mapAccumL cseBind emptyCSEnv binds)
cseBind :: CSEnv -> CoreBind -> (CSEnv, CoreBind)
cseBind env (NonRec b e)
More information about the ghc-commits
mailing list