insertClient :: Client -> Clients -> Clients
insertClient client clients = clients
    { byUid  = byUid'
    , byNick = byNick'
    }
  where byUid' = IM.insert (uid client) client (byUid clients)
        byNick' = case nick client of
            Nothing    -> byNick clients
            Just nick' -> M.insert (map toUpper nick') client (byNick clients)
insertClient :: Client -> Clients -> Clients
insertClient client clients = clients
    { byUid  = byUid'
    , byNick = byNick'
    }
  where byUid' = IM.insert (uid client) client (byUid clients)
        byNick' = case nick client of
            Nothing    -> byNick clients
            Just nick' -> M.insert (map toUpper nick') client (byNick clients)
insertClient client clients = clients
    { byUid  = byUid'
    , byNick = byNick'
    }
  where byUid' = IM.insert (uid client) client (byUid clients)
        byNick' = case nick client of
            Nothing    -> byNick clients
            Just nick' -> M.insert (map toUpper nick') client (byNick clients)