summaryrefslogtreecommitdiff
path: root/compiler/simplCore/CSE.lhs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2014-09-09 12:57:04 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2014-09-19 11:41:12 +0100
commit48f17f156c3bb608603575ade2788140fadab192 (patch)
tree737574f97d6b254cd93cbe22df913d1fd1d52165 /compiler/simplCore/CSE.lhs
parentebb7334c02c3014283f5f997f239b3cf58476cbc (diff)
downloadhaskell-48f17f156c3bb608603575ade2788140fadab192.tar.gz
Use mapAccumL (refactoring only)
Fixes Trac #9529
Diffstat (limited to 'compiler/simplCore/CSE.lhs')
-rw-r--r--compiler/simplCore/CSE.lhs9
1 files changed, 1 insertions, 8 deletions
diff --git a/compiler/simplCore/CSE.lhs b/compiler/simplCore/CSE.lhs
index 740aa5f94e..289388a39b 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)