diff options
-rw-r--r-- | Data/ConfigManager.hs | 6 | ||||
-rw-r--r-- | config-manager.cabal | 2 |
2 files changed, 5 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) diff --git a/config-manager.cabal b/config-manager.cabal index 13d66e3..6ea7573 100644 --- a/config-manager.cabal +++ b/config-manager.cabal @@ -5,7 +5,9 @@ description: A configuration management library which supports: . * name-value bindings, + . * required or optional imports, + . * and comments. homepage: https://gitlab.com/guyonvarch/config-manager bug-reports: https://gitlab.com/guyonvarch/config-manager/issues |