diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/Config.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/server/Config.hs b/src/server/Config.hs index 895b355..deb2e68 100644 --- a/src/server/Config.hs +++ b/src/server/Config.hs @@ -14,21 +14,21 @@ import Control.Monad.Trans.Error (runErrorT) import Control.Monad.IO.Class (liftIO) import Control.Monad (join) import Control.Arrow (left) -import Control.Applicative (liftA3) data Config = Config { hostname :: Text , port :: Int , signInExpirationMn :: Int + , currency :: Char } deriving (Read, Eq, Show) getConfig :: FilePath -> IO (Either Text Config) getConfig filePath = left (T.pack . show) <$> (runErrorT $ do cp <- join $ liftIO $ readfile emptyCP filePath - liftA3 - Config - (T.pack <$> get cp "DEFAULT" "hostname") - (get cp "DEFAULT" "port") - (get cp "DEFAULT" "sign-in-expiration-mn") + Config <$> + (T.pack <$> get cp "DEFAULT" "hostname") <*> + (get cp "DEFAULT" "port") <*> + (get cp "DEFAULT" "sign-in-expiration-mn") <*> + (get cp "DEFAULT" "currency") ) |