-- | Toggles a 'Flag' in a 'ProgramState'
toggleFlag :: IORef ProgramState -> Flag -> IO ()
toggleFlag ps f = do
  p <- get ps
  if f `elem` p ^. flags then clearFlag ps f else addFlag ps f

-- | Helper for '_extraInfo' that will only keep a preset amount of
-- logging information.
toggleFlag :: IORef ProgramState -> Flag -> IO ()
toggleFlag ps f = do
  p <- get ps
  if f `elem` p ^. flags then clearFlag ps f else addFlag ps f

-- | Helper for '_extraInfo' that will only keep a preset amount of
-- logging information.
toggleFlag ps f = do
  p <- get ps
  if f `elem` p ^. flags then clearFlag ps f else addFlag ps f

-- | Helper for '_extraInfo' that will only keep a preset amount of
-- logging information.