blob: b2b040853288178a20ef648d053d9203058cd649 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
{-# LANGUAGE OverloadedStrings #-}
module Main
( main
) where
import qualified Data.Text.IO as T
import qualified RenderError
import qualified Notification
import Model.Config
import Model.BirthdateParser (parseBirthdates)
import qualified Model.Path as Path
main :: IO ()
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
|