]> gitweb.michael.orlitzky.com - dead/halcyon.git/blobdiff - src/Mail.hs
Fix remaining hlint suggestions.
[dead/halcyon.git] / src / Mail.hs
index e1884afb9daf0c9fa2df33b67b30e81f82ab79a9..db5673f62c84bef2964e2e1cb4fb188ec3d43a49 100644 (file)
@@ -5,6 +5,7 @@ where
 
 import Control.Concurrent
 import Control.Exception (evaluate)
+import Control.Monad (liftM)
 import Data.List (intercalate)
 import Data.Time (formatTime, getZonedTime)
 import System.Exit
@@ -44,7 +45,7 @@ instance Show Message where
              (body m) ]
     where
       formatted_headers =
-        if (length (headers m) == 0)
+        if null (headers m)
         then ""
         else (intercalate "\n" (headers m)) ++ "\n"
 
@@ -62,9 +63,9 @@ pad_left str n
 -- | Constructs a 'String' in RFC822 date format for the current
 --   date/time.
 rfc822_now :: IO String
-rfc822_now = do
-  date <- getZonedTime
-  return $ formatTime defaultTimeLocale rfc822DateFormat date
+rfc822_now =
+  liftM (formatTime defaultTimeLocale rfc822DateFormat) getZonedTime
+
 
 
 
@@ -100,7 +101,7 @@ sendmail sendmail_path message = do
 -- errors, and exit codes.  This function pretty-prints one of those
 -- three-tuples.
 print_sendmail_result :: (String, String, ExitCode) -> IO ()
-print_sendmail_result (outs, errs, ec) = do
+print_sendmail_result (outs, errs, ec) =
   case ec of
     ExitSuccess -> return ()
     _ -> putStrLn $ concat ["Output: " ++ outs,