summaryrefslogtreecommitdiff
path: root/Hsbot/Types.hs
diff options
context:
space:
mode:
authorJulien Dessaux2011-05-06 19:15:40 +0200
committerJulien Dessaux2011-05-06 19:15:40 +0200
commita8c0c8578718098e7a0482678ab727533ee09862 (patch)
treec9a1d07d47e6089ba1fadacf595fd9dd8039a03e /Hsbot/Types.hs
parentAdded a shitload of ducks to recognize and kill! (diff)
downloadhsbot-a8c0c8578718098e7a0482678ab727533ee09862.tar.gz
hsbot-a8c0c8578718098e7a0482678ab727533ee09862.tar.bz2
hsbot-a8c0c8578718098e7a0482678ab727533ee09862.zip
Made the Plugin monad a Reader instead of a State since it can't change.
Diffstat (limited to '')
-rw-r--r--Hsbot/Types.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Hsbot/Types.hs b/Hsbot/Types.hs
index 14e89a1..c7331d3 100644
--- a/Hsbot/Types.hs
+++ b/Hsbot/Types.hs
@@ -7,8 +7,8 @@ module Hsbot.Types
, Env
, Message (..)
, Plugin
+ , PluginEnv (..)
, PluginId (..)
- , PluginState (..)
, TLSConfig (..)
) where
@@ -39,16 +39,16 @@ data BotEnv = BotEnv
type Bot = StateT BotState
data BotState = BotState
- { botPlugins :: M.Map String (PluginState, MVar PluginState, ThreadId)
+ { botPlugins :: M.Map String (PluginEnv, ThreadId)
, botHooks :: [Chan Message]
, botChannels :: [String]
, botNickname :: String
}
-- The Plugin monad
-type Plugin = StateT PluginState
+type Plugin = ReaderT PluginEnv
-data PluginState = PluginState
+data PluginEnv = PluginEnv
{ pluginId :: PluginId
, pluginChan :: Chan Message
, pluginMaster :: Chan Message