updateChanModes ::
  String {- lists,always,set,never -} ->
  IrcConnection -> IrcConnection
updateChanModes modes
  = over connChanModeTypes
  $ set modesLists listModes
  . set modesAlwaysArg alwaysModes
  . set modesSetArg setModes
  . set modesNeverArg neverModes
  where
  next = over _2 (drop 1) . break (==',')
  (listModes  ,modes1) = next modes
  (alwaysModes,modes2) = next modes1
  (setModes   ,modes3) = next modes2
  (neverModes ,_)      = next modes3
updateChanModes ::
  String {- lists,always,set,never -} ->
  IrcConnection -> IrcConnection
updateChanModes modes
  = over connChanModeTypes
  $ set modesLists listModes
  . set modesAlwaysArg alwaysModes
  . set modesSetArg setModes
  . set modesNeverArg neverModes
  where
  next = over _2 (drop 1) . break (==',')
  (listModes  ,modes1) = next modes
  (alwaysModes,modes2) = next modes1
  (setModes   ,modes3) = next modes2
  (neverModes ,_)      = next modes3
updateChanModes modes
  = over connChanModeTypes
  $ set modesLists listModes
  . set modesAlwaysArg alwaysModes
  . set modesSetArg setModes
  . set modesNeverArg neverModes
  where
  next = over _2 (drop 1) . break (==',')
  (listModes  ,modes1) = next modes
  (alwaysModes,modes2) = next modes1
  (setModes   ,modes3) = next modes2
  (neverModes ,_)      = next modes3