execCmdsLoop :: MIrc -> IO ()
execCmdsLoop mIrc = do
  server <- readMVar mIrc
  cmd <- readChan $ sCmdChan server
  case cmd of (SIrcAddEvent uEvent)     -> do
                _ <- swapMVar mIrc (server {sEvents =
                  (uncurry Map.insert uEvent) (sEvents server)})
                execCmdsLoop mIrc
              (SIrcChangeEvents evts) -> do
                _ <- swapMVar mIrc (server {sEvents = evts})
                execCmdsLoop mIrc
              (SIrcRemoveEvent key)     -> do
                _ <- swapMVar mIrc (server {sEvents =
                  Map.delete key (sEvents server)})
                execCmdsLoop mIrc
execCmdsLoop :: MIrc -> IO ()
execCmdsLoop mIrc = do
  server <- readMVar mIrc
  cmd <- readChan $ sCmdChan server
  case cmd of (SIrcAddEvent uEvent)     -> do
                _ <- swapMVar mIrc (server {sEvents =
                  (uncurry Map.insert uEvent) (sEvents server)})
                execCmdsLoop mIrc
              (SIrcChangeEvents evts) -> do
                _ <- swapMVar mIrc (server {sEvents = evts})
                execCmdsLoop mIrc
              (SIrcRemoveEvent key)     -> do
                _ <- swapMVar mIrc (server {sEvents =
                  Map.delete key (sEvents server)})
                execCmdsLoop mIrc
execCmdsLoop mIrc = do
  server <- readMVar mIrc
  cmd <- readChan $ sCmdChan server
  case cmd of (SIrcAddEvent uEvent)     -> do
                _ <- swapMVar mIrc (server {sEvents =
                  (uncurry Map.insert uEvent) (sEvents server)})
                execCmdsLoop mIrc
              (SIrcChangeEvents evts) -> do
                _ <- swapMVar mIrc (server {sEvents = evts})
                execCmdsLoop mIrc
              (SIrcRemoveEvent key)     -> do
                _ <- swapMVar mIrc (server {sEvents =
                  Map.delete key (sEvents server)})
                execCmdsLoop mIrc