summaryrefslogtreecommitdiff
path: root/HsBot
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2011-10-15 22:09:28 +0200
committerPaul Buetow <paul@buetow.org>2011-10-15 22:09:28 +0200
commit985413d54772605485c52d93518e02ab7615c542 (patch)
tree4d3108bd7f3212a805a2e47ca19dbd049f68b1d6 /HsBot
parent5fbbc84cbfb4831a9b08969b982b44a09d845ab0 (diff)
removed compile errors
Diffstat (limited to 'HsBot')
-rw-r--r--HsBot/Base/Conf.hs12
1 files changed, 8 insertions, 4 deletions
diff --git a/HsBot/Base/Conf.hs b/HsBot/Base/Conf.hs
index 3eada1d..774f473 100644
--- a/HsBot/Base/Conf.hs
+++ b/HsBot/Base/Conf.hs
@@ -22,11 +22,15 @@ makeConf = M.fromList
]
get :: (Monad m) => String -> Conf -> m String
-get = M.lookup
-
+get key conf = case M.lookup key conf of
+ Just val -> return (val)
+ Nothing -> return ("")
+
getUnwrappedInt :: String -> Conf -> Int
getUnwrappedInt key conf = read (getUnwrapped key conf) :: Int
getUnwrapped :: String -> Conf -> String
-getUnwrapped key conf = do { val <- get key conf; val }
-
+getUnwrapped key conf =
+ case M.lookup key conf of
+ Just val -> val
+ Nothing -> ""