summaryrefslogtreecommitdiffstats
path: root/ircout.hs
blob: 9b3de60eb0f1accbd2343c73b27e99ae90365d05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module Main where

import Control.Concurrent.Async
import Control.Monad (forever)
import System.IO (Handle)

import Kirk.Config
import Kirk.Simple


main :: IO ()
main = do
    c <- parseConfigFromArgs
    r <- run c $ \h ->
      handshake c h >> race (ircAgent c h) (stdinForwarder c h)
    print r


stdinForwarder :: Config -> Handle -> IO ()
stdinForwarder c h = forever (getLine >>= privmsg c h)