Archived
1
0
Fork 0
This repository has been archived on 2025-03-10. You can view files and clone it, but cannot push or open issues or pull requests.
hsbot/Hsbot/Message.hs
Julien Dessaux 864a364da9 Some API refactoring.
I can't say how I hate the Types.hs thing in Haskell!
2011-05-01 03:28:22 +02:00

21 lines
379 B
Haskell

module Hsbot.Message
( readMsg
, writeMsg
) where
import Control.Concurrent
import Control.Monad.State
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