From dd60905328d0ba2caca7d16526c03730a7c2730e Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 15 Oct 2011 22:08:35 +0200 Subject: removed compile errors --- HsBot/Base/Conf.hs | 12 ++++++++---- Makefile | 2 +- 2 files changed, 9 insertions(+), 5 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 -> "" diff --git a/Makefile b/Makefile index 7e5341d..5f80669 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ all: ghc --make Main.hs -o hsbot clean: - rm hsbot find . -name \*.o | xargs rm find . -name \*.hi | xargs rm + rm hsbot -- cgit v1.2.3