runIRCBot :: IO ()
runIRCBot = withSocketsDo $ mask $ \restore -> do
    mvar <- newEmptyMVar
    chan <- newTChanIO
    tid <- forkIO $ listener mvar chan
    (tvar, part) <- IRC.initChannelsPart S.empty
    (tids, _) <- IRC.simpleBot
         (IRC.nullBotConf { IRC.host = "irc.freenode.org"
                          , IRC.nick = utf8 "Pinobot"
                          , IRC.commandPrefix = "@"
                          , IRC.user =
                        IRC.nullUser { IRC.username = utf8 "pino"
                                     , IRC.realname = utf8 "Pinobot"
                                     , IRC.hostname = "trankesbel" } })
         [IRC.nickUserPart, IRC.pingPart, part, communicatorPart mvar tvar chan]
    finally (restore $ forever $ threadDelay 10000000) $ do
        killThread tid
        for_ tids killThread
runIRCBot :: IO ()
runIRCBot = withSocketsDo $ mask $ \restore -> do
    mvar <- newEmptyMVar
    chan <- newTChanIO
    tid <- forkIO $ listener mvar chan
    (tvar, part) <- IRC.initChannelsPart S.empty
    (tids, _) <- IRC.simpleBot
         (IRC.nullBotConf { IRC.host = "irc.freenode.org"
                          , IRC.nick = utf8 "Pinobot"
                          , IRC.commandPrefix = "@"
                          , IRC.user =
                        IRC.nullUser { IRC.username = utf8 "pino"
                                     , IRC.realname = utf8 "Pinobot"
                                     , IRC.hostname = "trankesbel" } })
         [IRC.nickUserPart, IRC.pingPart, part, communicatorPart mvar tvar chan]
    finally (restore $ forever $ threadDelay 10000000) $ do
        killThread tid
        for_ tids killThread
runIRCBot = withSocketsDo $ mask $ \restore -> do
    mvar <- newEmptyMVar
    chan <- newTChanIO
    tid <- forkIO $ listener mvar chan
    (tvar, part) <- IRC.initChannelsPart S.empty
    (tids, _) <- IRC.simpleBot
         (IRC.nullBotConf { IRC.host = "irc.freenode.org"
                          , IRC.nick = utf8 "Pinobot"
                          , IRC.commandPrefix = "@"
                          , IRC.user =
                        IRC.nullUser { IRC.username = utf8 "pino"
                                     , IRC.realname = utf8 "Pinobot"
                                     , IRC.hostname = "trankesbel" } })
         [IRC.nickUserPart, IRC.pingPart, part, communicatorPart mvar tvar chan]
    finally (restore $ forever $ threadDelay 10000000) $ do
        killThread tid
        for_ tids killThread