where
import Control.Concurrent
-import Control.Concurrent.MVar
import Control.Exception (evaluate)
import Data.List (intercalate)
import System.Exit
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
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
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 ()
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.