diff options
author | Joris | 2016-03-16 21:09:44 +0100 |
---|---|---|
committer | Joris | 2016-03-16 22:09:54 +0100 |
commit | c6c01d7c248bca1078285c4afeaa25493e9974b3 (patch) | |
tree | 7b060664b16ffcae25cb62089dfbeed5a0b7c69a /Data/ConfigManager.hs | |
parent | f2dc23683ceae93135223713e4ca7fa3a12edbea (diff) |
Add import expression
Diffstat (limited to 'Data/ConfigManager.hs')
-rw-r--r-- | Data/ConfigManager.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Data/ConfigManager.hs b/Data/ConfigManager.hs index d972cd8..eb15ddf 100644 --- a/Data/ConfigManager.hs +++ b/Data/ConfigManager.hs @@ -10,15 +10,14 @@ import Control.Monad (join) import Data.Text (Text) import qualified Data.Text as T -import qualified Data.Text.IO as T import qualified Data.HashMap.Strict as M import Data.ConfigManager.Config -import Data.ConfigManager.Parser (parseConfig) -import Data.ConfigManager.Types +import qualified Data.ConfigManager.Reader as R +import Data.ConfigManager.Expr readConfig :: FilePath -> IO (Either Text Config) -readConfig path = parseConfig <$> T.readFile path +readConfig = R.readConfig lookup :: Read a => Name -> Config -> Maybe a lookup name config = join . fmap (readMaybe . T.unpack) $ M.lookup name (hashMap config) |