X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fhalcyon.git;a=blobdiff_plain;f=src%2FMail.hs;h=db5673f62c84bef2964e2e1cb4fb188ec3d43a49;hp=8c1f25c89874eae68547f8323387b6116223419e;hb=d721869c5e7395c021cc79f40720bdb275d613d2;hpb=dd6cea3dc5e830691b1da442fcf91602e4cf94aa diff --git a/src/Mail.hs b/src/Mail.hs index 8c1f25c..db5673f 100644 --- a/src/Mail.hs +++ b/src/Mail.hs @@ -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 @@ -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,