diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-01-30 08:45:49 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-02-01 12:29:26 -0500 |
commit | 88fba8a4b3c22e953a634b81dd0b67ec66eb5e72 (patch) | |
tree | 75a46332ad32cfeaf4f4d52b3b60fd452f2493b6 /libraries/base/Control | |
parent | 06185102bb06d6d56e00d40172a6a473fc228501 (diff) | |
download | haskell-88fba8a4b3c22e953a634b81dd0b67ec66eb5e72.tar.gz |
Fix a few Note inconsistencies
Diffstat (limited to 'libraries/base/Control')
-rw-r--r-- | libraries/base/Control/Concurrent/QSem.hs | 2 | ||||
-rw-r--r-- | libraries/base/Control/Monad.hs | 3 | ||||
-rw-r--r-- | libraries/base/Control/Monad/ST/Imp.hs | 1 | ||||
-rw-r--r-- | libraries/base/Control/Monad/ST/Lazy/Imp.hs | 4 |
4 files changed, 4 insertions, 6 deletions
diff --git a/libraries/base/Control/Concurrent/QSem.hs b/libraries/base/Control/Concurrent/QSem.hs index 9f53eef826..08524323e2 100644 --- a/libraries/base/Control/Concurrent/QSem.hs +++ b/libraries/base/Control/Concurrent/QSem.hs @@ -100,7 +100,7 @@ signalQSem (QSem m) = putMVar m r' -- Note [signal uninterruptible] --- +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- If we have -- -- bracket waitQSem signalQSem (...) diff --git a/libraries/base/Control/Monad.hs b/libraries/base/Control/Monad.hs index 86c15daf00..d2d0e29e43 100644 --- a/libraries/base/Control/Monad.hs +++ b/libraries/base/Control/Monad.hs @@ -222,7 +222,7 @@ zipWithM f xs ys = sequenceA (zipWith f xs ys) zipWithM_ :: (Applicative m) => (a -> b -> m c) -> [a] -> [b] -> m () {-# INLINE zipWithM_ #-} -- Inline so that fusion with zipWith and sequenceA have a chance to fire --- See Note [Fusion for zipN/zipWithN] in List.hs] +-- See Note [Fusion for zipN/zipWithN] in List.hs. zipWithM_ f xs ys = sequenceA_ (zipWith f xs ys) {- | The 'foldM' function is analogous to 'Data.Foldable.foldl', except that its result is @@ -262,7 +262,6 @@ foldM_ f a xs = foldlM f a xs >> return () {- 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 example, would be: diff --git a/libraries/base/Control/Monad/ST/Imp.hs b/libraries/base/Control/Monad/ST/Imp.hs index cbcee8dd90..9658fbd635 100644 --- a/libraries/base/Control/Monad/ST/Imp.hs +++ b/libraries/base/Control/Monad/ST/Imp.hs @@ -62,7 +62,6 @@ fixST k = unsafeIOToST $ do {- Note [fixST] ~~~~~~~~~~~~ - For many years, we implemented fixST much like a pure fixpoint, using liftST: diff --git a/libraries/base/Control/Monad/ST/Lazy/Imp.hs b/libraries/base/Control/Monad/ST/Lazy/Imp.hs index de8310c76d..888839132e 100644 --- a/libraries/base/Control/Monad/ST/Lazy/Imp.hs +++ b/libraries/base/Control/Monad/ST/Lazy/Imp.hs @@ -68,7 +68,7 @@ newtype ST s a = ST { unST :: State s -> (a, State s) } data State s = S# (State# s) {- Note [Lazy ST and multithreading] - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We used to imagine that passing a polymorphic state token was all that we needed to keep state threads separate (see Launchbury and Peyton Jones, 1994: https://www.microsoft.com/en-us/research/publication/lazy-functional-state-threads/). @@ -87,7 +87,7 @@ one we get from the previous computation, and the unlifted one we pull out of thin air. -} {- Note [Lazy ST: not producing lazy pairs] - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The fixST and strictToLazyST functions used to construct functions that produced lazy pairs. Why don't we need that laziness? The ST type is kept abstract, so no one outside this module can ever get their hands on a (result, |