summaryrefslogtreecommitdiff
path: root/HsBot/Base/Conf.hs
diff options
context:
space:
mode:
authorpb <pb@9f8f72e9-4bf4-416e-b76e-7d4203597157>2010-03-28 11:09:30 +0000
committerpb <pb@9f8f72e9-4bf4-416e-b76e-7d4203597157>2010-03-28 11:09:30 +0000
commit80ff91aa5d6cda6adc1c97dc39b950dd7daed9d5 (patch)
tree4b1ad4310067e9ee9b5dcbae027844ed596e015f /HsBot/Base/Conf.hs
parent7a7302c5b86e89f3fc2fbc3476db731dfd6ed11b (diff)
git-svn-id: https://ssl.buetow.org/repos/hsbot/trunk@50 9f8f72e9-4bf4-416e-b76e-7d4203597157
Diffstat (limited to 'HsBot/Base/Conf.hs')
-rw-r--r--HsBot/Base/Conf.hs28
1 files changed, 28 insertions, 0 deletions
diff --git a/HsBot/Base/Conf.hs b/HsBot/Base/Conf.hs
new file mode 100644
index 0000000..54749ba
--- /dev/null
+++ b/HsBot/Base/Conf.hs
@@ -0,0 +1,28 @@
+module HsBot.Base.Conf where
+
+import qualified Data.Map as M
+
+type Conf = M.Map String String
+
+makeConf = M.fromList
+ [ ("name", "HsBot")
+ , ("version", "v0.0")
+ , ("databaseFile", "hsbot.db")
+ , ("maxMessageSize", "400")
+ , ("admin", "rantanplan")
+ , ("ircServer", "irc.german-elite.net")
+ , ("ircChannel", "#buetow.org")
+ , ("ircNick", "hotdog")
+ , ("ircPort", "6667")
+ , ("ircUser", "hsbot.haskell.eu")
+ ]
+
+get :: (Monad m) => String -> Conf -> m String
+get = M.lookup
+
+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 }
+