From c6c01d7c248bca1078285c4afeaa25493e9974b3 Mon Sep 17 00:00:00 2001 From: Joris Date: Wed, 16 Mar 2016 21:09:44 +0100 Subject: Add import expression --- Data/ConfigManager.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Data/ConfigManager.hs') 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) -- cgit v1.2.3