@@ -259,9 +259,8 @@ cacheDataProducer packageState dflags tm tcs = do
259259 rdrEnv = tcg_rdr_env $ fst $ tm_internals_ tm
260260 rdrElts = globalRdrEnvElts rdrEnv
261261
262− foldMapM :: (Foldable f, Monad m, Monoid b) => (a -> m b) -> f a -> m b
263− foldMapM f xs = foldr step return xs mempty where
264− step x r z = f x >>= \y -> r $! z `mappend` y
262+ foldMapM :: (Traversable f, Monad m, Monoid b) => (a -> m b) -> f a -> m b
263+ foldMapM f xs = foldMap id <$> traverse f xs
265264
266265 getCompls :: [GlobalRdrElt] -> IO ([CompItem],QualCompls)
267266 getCompls = foldMapM getComplsForOne
@@ -536,4 +535,4 @@ prefixes =
536535 , "$t"
537536 , "$c"
538537 , "$m"
539− ]
538+ ]