diff options
author | Julien Dessaux | 2011-05-06 19:15:40 +0200 |
---|---|---|
committer | Julien Dessaux | 2011-05-06 19:15:40 +0200 |
commit | a8c0c8578718098e7a0482678ab727533ee09862 (patch) | |
tree | c9a1d07d47e6089ba1fadacf595fd9dd8039a03e /Hsbot/Types.hs | |
parent | Added a shitload of ducks to recognize and kill! (diff) | |
download | hsbot-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 'Hsbot/Types.hs')
-rw-r--r-- | Hsbot/Types.hs | 8 |
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 |