Fix some "warn-unused-do-bind" warnings where we want to ignore the value
authorIan Lynagh <igloo@earth.li>
Fri, 10 Jul 2009 15:25:26 +0000 (15:25 +0000)
committerIan Lynagh <igloo@earth.li>
Fri, 10 Jul 2009 15:25:26 +0000 (15:25 +0000)
Control/Concurrent.hs
Control/Concurrent/SampleVar.hs
GHC/IO/Handle.hs
System/Environment.hs

index 2d9cf57..7ec65f2 100644 (file)
@@ -430,7 +430,7 @@ runInUnboundThread action = do
     if bound
         then do
             mv <- newEmptyMVar
-            forkIO (Exception.try action >>= putMVar mv)
+            _ <- forkIO (Exception.try action >>= putMVar mv)
             takeMVar mv >>= \ei -> case ei of
                 Left exception -> Exception.throw (exception :: SomeException)
                 Right result -> return result
index bdf5eac..a76346f 100644 (file)
@@ -69,7 +69,7 @@ emptySampleVar :: SampleVar a -> IO ()
 emptySampleVar v = do
    (readers, var) <- takeMVar v
    if readers > 0 then do
-     takeMVar var
+     _ <- takeMVar var
      putMVar v (0,var)
     else
      putMVar v (readers,var)
index 5becae8..1531b4a 100644 (file)
@@ -147,7 +147,7 @@ hSetFileSize handle size =
 hIsEOF :: Handle -> IO Bool
 hIsEOF handle =
   catch
-     (do hLookAhead handle; return False)
+     (hLookAhead handle >> return False)
      (\e -> if isEOFError e then return True else ioError e)
 
 -- ---------------------------------------------------------------------------
@@ -668,7 +668,7 @@ dupHandleTo filepath h other_side
   case cast devTo of
     Nothing   -> ioe_dupHandlesNotCompatible h
     Just dev' -> do 
-      IODevice.dup2 dev dev'
+      _ <- IODevice.dup2 dev dev'
       FileHandle _ m <- dupHandle_ dev' filepath other_side h_ mb_finalizer
       takeMVar m
 
index 247a905..b85bc42 100644 (file)
@@ -155,7 +155,8 @@ withArgv new_args act = do
   pName <- System.Environment.getProgName
   existing_args <- System.Environment.getArgs
   bracket (setArgs new_args)
-          (\argv -> do setArgs (pName:existing_args); freeArgv argv)
+          (\argv -> do _ <- setArgs (pName:existing_args)
+                       freeArgv argv)
           (const act)
 
 freeArgv :: Ptr CString -> IO ()