]> gitweb.michael.orlitzky.com - dead/halcyon.git/blobdiff - src/Main.hs
Fix a few hlint suggestions.
[dead/halcyon.git] / src / Main.hs
index 8c81555c60075952980b48198d3ee1f38ab5ec7e..14539c11a737defc430d35e8aed0491c9d3cb397 100644 (file)
@@ -2,11 +2,11 @@ module Main
 where
 
 import Control.Concurrent (forkIO, threadDelay)
-import Control.Monad (forever, when)
+import Control.Monad (forever, unless, when)
 import Data.Aeson (decode)
 import Data.List ((\\))
 import Data.Time.LocalTime (TimeZone, getCurrentTimeZone)
-import System.Exit (ExitCode(..), exitWith)
+import System.Exit (ExitCode(..), exitSuccess, exitWith)
 import System.IO (hPutStrLn, stderr)
 
 import CommandLine
@@ -85,13 +85,13 @@ filter_statuses cfg ss =
   replies  = filter reply ss
   retweets = filter retweeted ss
 
-  good_statuses' = case (ignore_replies cfg) of
-                         True  -> ss \\ replies
-                         False -> ss
+  good_statuses' = if (ignore_replies cfg)
+                   then ss \\ replies
+                   else ss
 
-  good_statuses = case (ignore_retweets cfg) of
-                    True  -> good_statuses' \\ retweets
-                    False -> good_statuses'
+  good_statuses = if (ignore_retweets cfg)
+                  then good_statuses' \\ retweets
+                  else good_statuses'
 
 
 
@@ -189,7 +189,7 @@ main = do
 
   -- If there  were errors parsing the command-line options,
   -- print them and exit.
-  when (not (null errors)) $ do
+  unless (null errors) $ do
       hPutStrLn stderr (concat errors)
       putStrLn help_text
       exitWith (ExitFailure exit_args_parse_failed)
@@ -199,7 +199,7 @@ main = do
   help <- help_set
   when (help) $ do
     putStrLn help_text
-    exitWith ExitSuccess
+    exitSuccess
 
   -- Get the list of usernames.
   usernames <- parse_usernames
@@ -215,7 +215,7 @@ main = do
   let run_twat_curried = run_twat cfg message
   _ <- mapM (forkIO . run_twat_curried) usernames
 
-  _ <- forever $ do
+  _ <- forever $
     -- 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.