aboutsummaryrefslogtreecommitdiff
path: root/Data/ConfigManager.hs
diff options
context:
space:
mode:
authorJoris2016-03-19 11:58:38 +0100
committerJoris2016-03-19 17:24:13 +0100
commit4c67e2c9dc817fb9d63b0951fbdc59252e6b8941 (patch)
tree726025169e3c78fa670f03bb17281866332d2190 /Data/ConfigManager.hs
parent3e5d3d47c90194403967e11994ea559b00b0f8ef (diff)
Update documentation
Diffstat (limited to 'Data/ConfigManager.hs')
-rw-r--r--Data/ConfigManager.hs6
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)