From 5375ad26dd78220185f1ffe05222250c06dc1a0c Mon Sep 17 00:00:00 2001 From: Joris Date: Sat, 21 Nov 2015 21:41:38 +0100 Subject: Get next week birthdays and send an empty mail for the moment --- src/Config.hs | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 src/Config.hs (limited to 'src/Config.hs') diff --git a/src/Config.hs b/src/Config.hs deleted file mode 100644 index c01bbe1..0000000 --- a/src/Config.hs +++ /dev/null @@ -1,32 +0,0 @@ -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE FlexibleContexts #-} - -module 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) -import Control.Applicative (liftA2) - -data Config = Config - { mailTo :: Text - , mailFrom :: 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 - liftA2 - Config - (T.pack <$> get cp "DEFAULT" "mail-to") - (T.pack <$> get cp "DEFAULT" "mail-from") - ) -- cgit v1.2.3