summaryrefslogtreecommitdiff
path: root/libraries/base/Data/Foldable.hs
diff options
context:
space:
mode:
authorTakano Akio <aljee@hyper.cx>2015-08-05 14:23:22 +0200
committerBen Gamari <ben@smart-cactus.org>2015-08-05 14:45:16 +0200
commit22bbc1cf209d44b8bb8897ae7a35f9ebaf411b10 (patch)
tree9604a8e2456b1c148ac99859efd365a30f2dda00 /libraries/base/Data/Foldable.hs
parentb12dba7829742de98a483645142c7962b9dd9f3f (diff)
downloadhaskell-22bbc1cf209d44b8bb8897ae7a35f9ebaf411b10.tar.gz
Make sure that `all`, `any`, `and`, and `or` fuse (#9848)
Test Plan: validate Reviewers: hvr, austin, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1126 GHC Trac Issues: #9848
Diffstat (limited to 'libraries/base/Data/Foldable.hs')
-rw-r--r--libraries/base/Data/Foldable.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/libraries/base/Data/Foldable.hs b/libraries/base/Data/Foldable.hs
index 1f20261943..24b6dd18c2 100644
--- a/libraries/base/Data/Foldable.hs
+++ b/libraries/base/Data/Foldable.hs
@@ -119,6 +119,8 @@ class Foldable t where
-- | Map each element of the structure to a monoid,
-- and combine the results.
foldMap :: Monoid m => (a -> m) -> t a -> m
+ {-# INLINE foldMap #-}
+ -- This INLINE allows more list functions to fuse. See Trac #9848.
foldMap f = foldr (mappend . f) mempty
-- | Right-associative fold of a structure.