[commit: ghc] master: Typos in Note (8987ce0)
git at git.haskell.org
git at git.haskell.org
Sun Apr 10 21:44:45 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/8987ce067d187878f82005293f6b215dec66df48/ghc
>---------------------------------------------------------------
commit 8987ce067d187878f82005293f6b215dec66df48
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Sun Apr 10 23:47:25 2016 +0200
Typos in Note
>---------------------------------------------------------------
8987ce067d187878f82005293f6b215dec66df48
libraries/base/Control/Monad.hs | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/libraries/base/Control/Monad.hs b/libraries/base/Control/Monad.hs
index a964581..255f80c 100644
--- a/libraries/base/Control/Monad.hs
+++ b/libraries/base/Control/Monad.hs
@@ -175,8 +175,8 @@ foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m ()
foldM_ f a xs = foldlM f a xs >> return ()
{-
-Note [Worker/wrapper transform on replicateM/replicateM_
---------------------------------------------------------
+Note [Worker/wrapper transform on replicateM/replicateM_]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The implementations of replicateM and replicateM_ both leverage the
worker/wrapper transform. The simpler implementation of replicateM_, as an
@@ -185,17 +185,14 @@ example, would be:
replicateM_ 0 _ = pure ()
replicateM_ n f = f *> replicateM_ (n - 1) f
-However, the self-recrusive nature of this implementation inhibits inlining,
+However, the self-recursive nature of this implementation inhibits inlining,
which means we never get to specialise to the action (`f` in the code above).
By contrast, the implementation below with a local loop makes it possible to
-inline the entire definition (as hapens for foldr, for example) thereby
+inline the entire definition (as happens for foldr, for example) thereby
specialising for the particular action.
For further information, see this Trac comment, which includes side-by-side
-Core.
-
-https://ghc.haskell.org/trac/ghc/ticket/11795#comment:6
-
+Core: https://ghc.haskell.org/trac/ghc/ticket/11795#comment:6
-}
-- | @'replicateM' n act@ performs the action @n@ times,
More information about the ghc-commits
mailing list