diff options
Diffstat (limited to 'Data')
-rw-r--r-- | Data/ConfigManager.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Data/ConfigManager.hs b/Data/ConfigManager.hs index 00968f5..edc2e93 100644 --- a/Data/ConfigManager.hs +++ b/Data/ConfigManager.hs @@ -39,18 +39,18 @@ import qualified Data.HashMap.Strict as M import qualified Data.ConfigManager.Reader as R import Data.ConfigManager.Types --- | Load a 'Config' from a given 'FilePath' +-- | Load a 'Config' from a given 'FilePath'. readConfig :: FilePath -> IO (Either Text Config) readConfig = R.readConfig Required --- | Lookup for the value associated to a name +-- | Lookup for the value associated to a name. lookup :: Read a => Name -> Config -> Maybe a lookup name config = join . fmap (readMaybe . T.unpack) $ M.lookup name (hashMap config) -- | Lookup for the value associated to a name and return the default value if --- no binding exists with the given name +-- no binding exists with the given name. lookupDefault :: Value -> Name -> Config -> Value lookupDefault defaultValue name config = M.lookupDefault defaultValue name (hashMap config) |