From d8eedc3e2639f0f50f0554f89dc121da4941d4d1 Mon Sep 17 00:00:00 2001 From: Joris Date: Mon, 4 Apr 2016 22:48:33 +0200 Subject: Rename birthday to event --- src/Model/Config.hs | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 src/Model/Config.hs (limited to 'src/Model/Config.hs') 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") - ) -- cgit v1.2.3