summaryrefslogtreecommitdiff
path: root/libraries/base/Control
diff options
context:
space:
mode:
authorHécate <hecate+gitlab@glitchbra.in>2020-09-18 20:07:49 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-09-23 20:44:24 -0400
commit31fea307499009977fdf3dadedc98cfef986077a (patch)
treecac7edf234b82d16c3edd53fc38539fcc2766cb5 /libraries/base/Control
parenta997fa01d907fc1992dc8c3ebc73f98e7a1486f7 (diff)
downloadhaskell-31fea307499009977fdf3dadedc98cfef986077a.tar.gz
Remove redundant "do", "return" and language extensions from base
Diffstat (limited to 'libraries/base/Control')
-rw-r--r--libraries/base/Control/Concurrent/Chan.hs2
-rw-r--r--libraries/base/Control/Concurrent/QSem.hs2
-rw-r--r--libraries/base/Control/Concurrent/QSemN.hs2
-rw-r--r--libraries/base/Control/Monad/ST/Lazy/Imp.hs2
4 files changed, 4 insertions, 4 deletions
diff --git a/libraries/base/Control/Concurrent/Chan.hs b/libraries/base/Control/Concurrent/Chan.hs
index 874e48a1a1..1599ae3048 100644
--- a/libraries/base/Control/Concurrent/Chan.hs
+++ b/libraries/base/Control/Concurrent/Chan.hs
@@ -105,7 +105,7 @@ writeChan (Chan _ writeVar) val = do
-- Throws 'Control.Exception.BlockedIndefinitelyOnMVar' when the channel is
-- empty and no other thread holds a reference to the channel.
readChan :: Chan a -> IO a
-readChan (Chan readVar _) = do
+readChan (Chan readVar _) =
modifyMVar readVar $ \read_end -> do
(ChItem val new_read_end) <- readMVar read_end
-- Use readMVar here, not takeMVar,
diff --git a/libraries/base/Control/Concurrent/QSem.hs b/libraries/base/Control/Concurrent/QSem.hs
index 133d6e2ab8..9f53eef826 100644
--- a/libraries/base/Control/Concurrent/QSem.hs
+++ b/libraries/base/Control/Concurrent/QSem.hs
@@ -82,7 +82,7 @@ waitQSem (QSem m) =
putMVar m (z, b1, b2)
return ()
where
- wait b = takeMVar b `onException` do
+ wait b = takeMVar b `onException`
(uninterruptibleMask_ $ do -- Note [signal uninterruptible]
(i,b1,b2) <- takeMVar m
r <- tryTakeMVar b
diff --git a/libraries/base/Control/Concurrent/QSemN.hs b/libraries/base/Control/Concurrent/QSemN.hs
index ea3236b0a4..1262198796 100644
--- a/libraries/base/Control/Concurrent/QSemN.hs
+++ b/libraries/base/Control/Concurrent/QSemN.hs
@@ -93,7 +93,7 @@ waitQSemN qs@(QSemN m) sz = mask_ $ do
JustMV b -> wait b
where
wait :: MVar () -> IO ()
- wait b = do
+ wait b =
takeMVar b `onException` do
already_filled <- not <$> tryPutMVar b ()
when already_filled $ signalQSemN qs sz
diff --git a/libraries/base/Control/Monad/ST/Lazy/Imp.hs b/libraries/base/Control/Monad/ST/Lazy/Imp.hs
index db900d9579..de8310c76d 100644
--- a/libraries/base/Control/Monad/ST/Lazy/Imp.hs
+++ b/libraries/base/Control/Monad/ST/Lazy/Imp.hs
@@ -42,7 +42,7 @@ import Control.Monad.Fix
import qualified Control.Monad.ST as ST
import qualified Control.Monad.ST.Unsafe as ST
-import qualified GHC.ST as GHC.ST
+import qualified GHC.ST
import GHC.Base
-- | The lazy @'ST'@ monad.