merge GHC HEAD
[ghc-hetmet.git] / compiler / utils / State.hs
index f28a8ef..0b6a285 100644 (file)
@@ -1,5 +1,5 @@
 
-module State where
+module State (module State, mapAccumLM {- XXX hack -}) where
 
 import MonadUtils
 
@@ -46,18 +46,3 @@ execState s i = case runState' s i of
 runState :: State s a -> s -> (a, s)
 runState s i = case runState' s i of
                (# a, s' #) -> (a, s')
-
-
-mapAccumLM
-        :: Monad m
-        => (acc -> x -> m (acc, y))     -- ^ combining funcction
-        -> acc                          -- ^ initial state
-        -> [x]                          -- ^ inputs
-        -> m (acc, [y])                 -- ^ final state, outputs
-
-mapAccumLM _ s [] = return (s, [])
-mapAccumLM f s (x:xs)
- = do (s1, x')  <- f s x
-      (s2, xs') <- mapAccumLM f s1 xs
-      return (s2, x' : xs')
-