aboutsummaryrefslogtreecommitdiff
path: root/Data/ConfigManager.hs
diff options
context:
space:
mode:
authorJoris2016-03-16 21:09:44 +0100
committerJoris2016-03-16 22:09:54 +0100
commitc6c01d7c248bca1078285c4afeaa25493e9974b3 (patch)
tree7b060664b16ffcae25cb62089dfbeed5a0b7c69a /Data/ConfigManager.hs
parentf2dc23683ceae93135223713e4ca7fa3a12edbea (diff)
Add import expression
Diffstat (limited to 'Data/ConfigManager.hs')
-rw-r--r--Data/ConfigManager.hs7
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)