diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Main.hs | 9 | ||||
-rw-r--r-- | src/Notification.hs | 6 |
2 files changed, 6 insertions, 9 deletions
diff --git a/src/Main.hs b/src/Main.hs index b2b0408..2cd4c28 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -18,9 +18,6 @@ main = do eitherBirthdates <- parseBirthdates <$> T.readFile Path.birthdate eitherConfig <- getConfig Path.config case (eitherBirthdates, eitherConfig) of - (Left err, _) -> - RenderError.birthdate err - (_, Left err) -> - RenderError.config err - (Right birthdates, Right config) -> do - Notification.todayAndNextWeek birthdates config + (Left err, _) -> RenderError.birthdate err + (_, Left err) -> RenderError.config err + (Right birthdates, Right config) -> notifyTodayAndNextWeek birthdates config diff --git a/src/Notification.hs b/src/Notification.hs index e5abe45..18cd260 100644 --- a/src/Notification.hs +++ b/src/Notification.hs @@ -1,7 +1,7 @@ {-# LANGUAGE OverloadedStrings #-} module Notification - ( todayAndNextWeek + ( notifyTodayAndNextWeek ) where import qualified Data.Text as T @@ -14,8 +14,8 @@ import Model.Birthdate (Birthdate, filterBirthdayAt, filterBirthdayBetween) import Model.Mail (mailSubject, mailBody) import Model.Config -todayAndNextWeek :: [Birthdate] -> Config -> IO () -todayAndNextWeek birthdates config = do +notifyTodayAndNextWeek :: [Birthdate] -> Config -> IO () +notifyTodayAndNextWeek birthdates config = do currentDate <- getCurrentDate birthdaysToday <- filterBirthdaysToday birthdates birthdaysNextWeek <- filterBirthdaysNextWeek birthdates config |