diff options
Diffstat (limited to 'libraries/base/Control')
-rw-r--r-- | libraries/base/Control/Monad.hs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libraries/base/Control/Monad.hs b/libraries/base/Control/Monad.hs index 75bc2b2db3..fbdb99e5f4 100644 --- a/libraries/base/Control/Monad.hs +++ b/libraries/base/Control/Monad.hs @@ -191,6 +191,8 @@ forever a = let a' = a *> a' in a' -- data structures or a state monad. mapAndUnzipM :: (Applicative m) => (a -> m (b,c)) -> [a] -> m ([b], [c]) {-# INLINE mapAndUnzipM #-} +-- Inline so that fusion with 'unzip' and 'traverse' has a chance to fire. +-- See Note [Inline @unzipN@ functions] in GHC/OldList.hs. mapAndUnzipM f xs = unzip <$> traverse f xs -- | The 'zipWithM' function generalizes 'zipWith' to arbitrary applicative functors. |