From: Ian Lynagh Date: Fri, 10 Jul 2009 20:45:13 +0000 (+0000) Subject: Fix some "warn-unused-do-bind" warnings where we want to ignore the value X-Git-Url: http://git.megacz.com/?p=ghc-base.git;a=commitdiff_plain;h=632f3da3ff5702d42b00521d620dc61b8f6ea048 Fix some "warn-unused-do-bind" warnings where we want to ignore the value --- diff --git a/Control/OldException.hs b/Control/OldException.hs index 936d03e..7d4899c 100644 --- a/Control/OldException.hs +++ b/Control/OldException.hs @@ -456,8 +456,8 @@ bracket before after thing = a <- before r <- catch (unblock (thing a)) - (\e -> do { after a; throw e }) - after a + (\e -> do { _ <- after a; throw e }) + _ <- after a return r ) #endif @@ -473,8 +473,8 @@ a `finally` sequel = block (do r <- catch (unblock a) - (\e -> do { sequel; throw e }) - sequel + (\e -> do { _ <- sequel; throw e }) + _ <- sequel return r ) @@ -495,7 +495,7 @@ bracketOnError before after thing = a <- before catch (unblock (thing a)) - (\e -> do { after a; throw e }) + (\e -> do { _ <- after a; throw e }) ) -- ----------------------------------------------------------------------------- diff --git a/GHC/PArr.hs b/GHC/PArr.hs index e56d83f..a21d2fd 100644 --- a/GHC/PArr.hs +++ b/GHC/PArr.hs @@ -507,7 +507,7 @@ dpermuteP is es dft | isLen /= esLen = error "GHC.PArr: arguments must be of the same length" | otherwise = runST (do marr <- newArray dftLen noElem - trans 0 (isLen - 1) marr dft copyOne noAL + _ <- trans 0 (isLen - 1) marr dft copyOne noAL permute marr is es mkPArr dftLen marr) where diff --git a/GHC/TopHandler.lhs b/GHC/TopHandler.lhs index ffc62f9..5b07bad 100644 --- a/GHC/TopHandler.lhs +++ b/GHC/TopHandler.lhs @@ -83,8 +83,8 @@ install_interrupt_handler handler = do -- isn't available here. install_interrupt_handler handler = do let sig = CONST_SIGINT :: CInt - setHandler sig (Just (const handler, toDyn handler)) - stg_sig_install sig STG_SIG_RST nullPtr + _ <- setHandler sig (Just (const handler, toDyn handler)) + _ <- stg_sig_install sig STG_SIG_RST nullPtr -- STG_SIG_RST: the second ^C kills us for real, just in case the -- RTS or program is unresponsive. return () diff --git a/System/Mem/Weak.hs b/System/Mem/Weak.hs index e6a8a37..208302f 100644 --- a/System/Mem/Weak.hs +++ b/System/Mem/Weak.hs @@ -104,7 +104,7 @@ mkWeakPtr key finalizer = mkWeak key key finalizer -} addFinalizer :: key -> IO () -> IO () addFinalizer key finalizer = do - mkWeakPtr key (Just finalizer) -- throw it away + _ <- mkWeakPtr key (Just finalizer) -- throw it away return () -- | A specialised version of 'mkWeak' where the value is actually a pair