Archived
1
0
Fork 0

Some API refactoring.

I can't say how I hate the Types.hs thing in Haskell!
This commit is contained in:
Julien Dessaux 2011-04-24 23:08:06 +02:00
parent d4be110200
commit 864a364da9
7 changed files with 47 additions and 51 deletions

View file

@ -1,9 +1,21 @@
module Hsbot.Message
( Message (..)
( readMsg
, writeMsg
) where
import qualified Network.IRC as IRC
import Control.Concurrent
import Control.Monad.State
data Message = IncomingMsg IRC.Message
| OutgoingMsg IRC.Message
import Hsbot.Types
-- Plugin Utils
readMsg :: Plugin IO (Message)
readMsg = do
chan <- gets pluginChan
liftIO $ readChan chan >>= return
writeMsg :: Message -> Plugin IO ()
writeMsg msg = do
chan <- gets pluginMaster
liftIO $ writeChan chan msg