summaryrefslogtreecommitdiff
path: root/libraries/base/Data
diff options
context:
space:
mode:
authorAustin Seipp <austin@well-typed.com>2015-02-17 09:08:12 -0600
committerAustin Seipp <austin@well-typed.com>2015-02-18 09:45:10 -0600
commit91d9530525803403c3c012901115d54ff4fc3b5e (patch)
tree8acf239cc007fb97696530567f7365d5b50b8c47 /libraries/base/Data
parent1b82619bc2ff36341d916c56b0cd67a378a9c222 (diff)
downloadhaskell-91d9530525803403c3c012901115d54ff4fc3b5e.tar.gz
Revert "Eta-expand argument to foldr in mapM_ for []"
This change lacked justification (or a test!) for its improvements, and I merged it on a sweep of Phabricator without fixing this. Trac #10034. This reverts commit 7cf87fc6928f0252d9f61719e2344e6c69237079.
Diffstat (limited to 'libraries/base/Data')
-rw-r--r--libraries/base/Data/Foldable.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/libraries/base/Data/Foldable.hs b/libraries/base/Data/Foldable.hs
index b8b0973a8c..a745f66092 100644
--- a/libraries/base/Data/Foldable.hs
+++ b/libraries/base/Data/Foldable.hs
@@ -349,8 +349,7 @@ for_ = flip traverse_
-- As of base 4.8.0.0, 'mapM_' is just 'traverse_', specialized to
-- 'Monad'.
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
-{-# INLINE mapM_ #-}
-mapM_ f = foldr (\m n -> f m >> n) (return ())
+mapM_ f= foldr ((>>) . f) (return ())
-- | 'forM_' is 'mapM_' with its arguments flipped. For a version that
-- doesn't ignore the results see 'Data.Traversable.forM'.