diff options
Diffstat (limited to 'src/Main.hs')
-rw-r--r-- | src/Main.hs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Main.hs b/src/Main.hs index 9debfe1..9b5541c 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -10,7 +10,8 @@ import qualified Data.Text as T import qualified Data.Text.IO as T import Date (getCurrentDate) -import Birthdate (readBirthdates, filterBirthday) +import Birthdate (filterBirthday) +import BirthdateParser (parseBirthdates) import Mail (mailSubject, mailBody) import SendMail (sendMail) import Config @@ -23,24 +24,24 @@ configPath = "config.txt" main :: IO () main = do - eitherBirthdates <- readBirthdates birthdatePath + eitherBirthdates <- parseBirthdates <$> T.readFile birthdatePath eitherConfig <- getConfig configPath case (eitherBirthdates, eitherConfig) of - (Left error, _) -> + (Left err, _) -> T.hPutStr stderr $ T.concat [ "Error while parsing file " , T.pack birthdatePath , ":\n" - , error + , err ] - (_, Left error) -> + (_, Left err) -> T.hPutStr stderr $ T.concat [ "Error while parsing config file " , T.pack birthdatePath , ":\n" - , error + , err ] (Right birthdates, Right config) -> do currentDate <- getCurrentDate |