[commit: ghc] master: Remove a copy of foldM, and use the standard function instead (6759e5a)

Ian Lynagh <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/6759e5a482d927870c90efe97b820d492785a6fd

>---------------------------------------------------------------

commit 6759e5a482d927870c90efe97b820d492785a6fd
Author: Ian Lynagh <[email protected]>
Date:   Tue Oct 16 13:27:17 2012 +0100

    Remove a copy of foldM, and use the standard function instead

>---------------------------------------------------------------

 compiler/simplStg/SimplStg.lhs |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/compiler/simplStg/SimplStg.lhs b/compiler/simplStg/SimplStg.lhs
index bf9a217..dbf6cb7 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}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.