From 5f1220bd5d1b6893a4e2c0a179b3244a12eae6c8 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 25 Oct 2010 02:28:17 -0400 Subject: [PATCH] Clean up compiler warnings. --- src/Mail.hs | 7 +++---- src/Main.hs | 8 ++++---- src/Twitter/Xml.hs | 1 - 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Mail.hs b/src/Mail.hs index c93a6cf..7f0fd8b 100644 --- a/src/Mail.hs +++ b/src/Mail.hs @@ -4,7 +4,6 @@ module Mail where import Control.Concurrent -import Control.Concurrent.MVar import Control.Exception (evaluate) import Data.List (intercalate) import System.Exit @@ -122,9 +121,9 @@ sendmail message = do errm <- newEmptyMVar errs <- hGetContents errh - forkIO $ hPutStr inh (show message) >> hClose inh - forkIO $ evaluate (length outs) >> putMVar outm () - forkIO $ evaluate (length errs) >> putMVar errm () + _ <- forkIO $ hPutStr inh (show message) >> hClose inh + _ <- forkIO $ evaluate (length outs) >> putMVar outm () + _ <- forkIO $ evaluate (length errs) >> putMVar errm () readMVar outm readMVar errm diff --git a/src/Main.hs b/src/Main.hs index de20989..f6fd170 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -58,7 +58,7 @@ recurse username latest_status_id maybe_message = do recurse username latest_status_id maybe_message _ -> do let new_latest_status_id = get_max_status_id new_statuses - mapM (putStrLn . pretty_print) new_statuses + _ <- mapM (putStrLn . pretty_print) new_statuses case maybe_message of Nothing -> do @@ -68,7 +68,7 @@ recurse username latest_status_id maybe_message = do date_header <- construct_date_header let messages = map (message_from_status message (date_header)) new_statuses sendmail_results <- mapM sendmail messages - mapM print_sendmail_result sendmail_results + _ <- mapM print_sendmail_result sendmail_results recurse username new_latest_status_id maybe_message return () @@ -145,9 +145,9 @@ main = do from = fromaddr }) -- Execute run_twat on each username in a new thread. - mapM (forkIO . (run_twat message)) usernames + _ <- mapM (forkIO . (run_twat message)) usernames - forever $ do + _ <- forever $ do -- This thread (the one executing main) doesn't do anything, -- but when it terminates, so do all the threads we forked. -- As a result, we need to keep this thread on life support. diff --git a/src/Twitter/Xml.hs b/src/Twitter/Xml.hs index b34c6fb..8ffd9dd 100644 --- a/src/Twitter/Xml.hs +++ b/src/Twitter/Xml.hs @@ -2,7 +2,6 @@ module Twitter.Xml where -import Data.Maybe import Test.HUnit import Text.Regex (mkRegex, subRegex) import Text.XML.HaXml -- 2.44.2