From a8c0c8578718098e7a0482678ab727533ee09862 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Fri, 6 May 2011 19:15:40 +0200 Subject: Made the Plugin monad a Reader instead of a State since it can't change. --- Hsbot/Message.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Hsbot/Message.hs') diff --git a/Hsbot/Message.hs b/Hsbot/Message.hs index 1382098..d6697cd 100644 --- a/Hsbot/Message.hs +++ b/Hsbot/Message.hs @@ -5,17 +5,17 @@ module Hsbot.Message ) where import Control.Concurrent -import Control.Monad.State +import Control.Monad.Reader import qualified Network.IRC as IRC import Hsbot.Types -- Plugin Utils readMsg :: Plugin (Env IO) Message -readMsg = gets pluginChan >>= liftIO . readChan +readMsg = asks pluginChan >>= liftIO . readChan writeMsg :: Message -> Plugin (Env IO) () -writeMsg msg = gets pluginMaster >>= liftIO . flip writeChan msg +writeMsg msg = asks pluginMaster >>= liftIO . flip writeChan msg answerMsg :: IRC.Message -> String -> Plugin (Env IO) () answerMsg request msg = -- cgit v1.2.3