diff options
author | Joris | 2016-04-04 22:48:33 +0200 |
---|---|---|
committer | Joris | 2016-04-04 22:48:33 +0200 |
commit | d8eedc3e2639f0f50f0554f89dc121da4941d4d1 (patch) | |
tree | 81bd4d0a261b0550a0501ad2f70fa52b4ee21000 /src/Model/Config.hs | |
parent | e66ea0b49c8f7202114df366668598026f211eba (diff) |
Rename birthday to event
Diffstat (limited to 'src/Model/Config.hs')
-rw-r--r-- | src/Model/Config.hs | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/Model/Config.hs b/src/Model/Config.hs deleted file mode 100644 index b583048..0000000 --- a/src/Model/Config.hs +++ /dev/null @@ -1,32 +0,0 @@ -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE FlexibleContexts #-} - -module Model.Config - ( getConfig - , Config(..) - ) where - -import Data.ConfigFile -import Data.Text (Text) -import qualified Data.Text as T - -import Control.Monad.Trans.Error (runErrorT) -import Control.Monad.IO.Class (liftIO) -import Control.Monad (join) -import Control.Arrow (left) - -data Config = Config - { mailTo :: Text - , mailFrom :: Text - , dayForNextWeekNotification :: Text - } deriving (Read, Eq, Show) - -getConfig :: FilePath -> IO (Either Text Config) -getConfig filePath = - left (T.pack . show) <$> (runErrorT $ do - cp <- join $ liftIO $ readfile emptyCP filePath - Config <$> - (T.pack <$> get cp "DEFAULT" "mail-to") <*> - (T.pack <$> get cp "DEFAULT" "mail-from") <*> - (T.pack <$> get cp "DEFAULT" "day-for-next-week-notification") - ) |