summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-10-16 13:27:17 +0100
committerIan Lynagh <ian@well-typed.com>2012-10-16 13:27:17 +0100
commit6759e5a482d927870c90efe97b820d492785a6fd (patch)
treebdd9897eb744f8b01e3980521c11ee8c989e16b8
parent4d4797de8b5772167e12b0e47761826affa7cbf0 (diff)
downloadhaskell-6759e5a482d927870c90efe97b820d492785a6fd.tar.gz
Remove a copy of foldM, and use the standard function instead
-rw-r--r--compiler/simplStg/SimplStg.lhs9
1 files changed, 2 insertions, 7 deletions
diff --git a/compiler/simplStg/SimplStg.lhs b/compiler/simplStg/SimplStg.lhs
index bf9a2170bc..dbf6cb7a66 100644
--- a/compiler/simplStg/SimplStg.lhs
+++ b/compiler/simplStg/SimplStg.lhs
@@ -23,6 +23,7 @@ import ErrUtils
import SrcLoc
import UniqSupply ( mkSplitUniqSupply, splitUniqSupply )
import Outputable
+import Control.Monad
\end{code}
\begin{code}
@@ -44,7 +45,7 @@ stg2stg dflags module_name binds
-- Do the main business!
; let (us0, us1) = splitUniqSupply us'
; (processed_binds, _, cost_centres)
- <- foldl_mn do_stg_pass (binds', us0, ccs) (getStgToDo dflags)
+ <- foldM do_stg_pass (binds', us0, ccs) (getStgToDo dflags)
; let un_binds = unarise us1 processed_binds
@@ -87,10 +88,4 @@ stg2stg dflags module_name binds
-- UniqueSupply for the next guy to use
-- cost-centres to be declared/registered (specialised)
-- add to description of what's happened (reverse order)
-
--- here so it can be inlined...
-foldl_mn :: (b -> a -> IO b) -> b -> [a] -> IO b
-foldl_mn _ z [] = return z
-foldl_mn f z (x:xs) = f z x >>= \ zz ->
- foldl_mn f zz xs
\end{code}