]> gitweb.michael.orlitzky.com - dead/halcyon.git/blobdiff - src/Main.hs
Create a Usernames newtype to fix an orphan instance.
[dead/halcyon.git] / src / Main.hs
index 40703d7ea9170c10110efe3787ce070c47786256..b4fd956f2114d1f3a32f2b6126572811aa603a20 100644 (file)
@@ -24,7 +24,7 @@ import Mail (
 import Twitter.Http
 import Twitter.Status
 import Twitter.User
-
+import Usernames (Usernames(..))
 
 -- | A wrapper around threadDelay which takes seconds instead of
 --   microseconds as its argument.
@@ -205,7 +205,7 @@ main = do
   -- set in either the config file or on the command-line.
   let cfg = merge_optional default_config opt_config
 
-  when (null $ usernames cfg) $ do
+  when (null $ get_usernames (usernames cfg)) $ do
     hPutStrLn stderr "ERROR: no usernames supplied."
     _ <- show_help
     exitWith (ExitFailure exit_no_usernames)
@@ -216,7 +216,7 @@ main = do
 
   -- Execute run_twat on each username in a new thread.
   let run_twat_curried = run_twat cfg message
-  _ <- mapM (forkIO . run_twat_curried) (usernames cfg)
+  _ <- mapM (forkIO . run_twat_curried) (get_usernames (usernames cfg))
 
   _ <- forever $
     -- This thread (the one executing main) doesn't do anything,