updateStatusBars :: DynamicStatusBar -> DynamicStatusBarCleanup -> X ()
updateStatusBars sb cleanup = do
  (dsbInfoScreens, dsbInfoHandles) <- XS.get >>= return . unzip . dsbInfo
  screens <- getScreens
  when (screens /= dsbInfoScreens) $ do
      newHandles <- liftIO $ do
          hClose `mapM_` dsbInfoHandles
          cleanup
          mapM sb screens
      XS.put $ DynStatusBarInfo (zip screens newHandles)
updateStatusBars :: DynamicStatusBar -> DynamicStatusBarCleanup -> X ()
updateStatusBars sb cleanup = do
  (dsbInfoScreens, dsbInfoHandles) <- XS.get >>= return . unzip . dsbInfo
  screens <- getScreens
  when (screens /= dsbInfoScreens) $ do
      newHandles <- liftIO $ do
          hClose `mapM_` dsbInfoHandles
          cleanup
          mapM sb screens
      XS.put $ DynStatusBarInfo (zip screens newHandles)
updateStatusBars sb cleanup = do
  (dsbInfoScreens, dsbInfoHandles) <- XS.get >>= return . unzip . dsbInfo
  screens <- getScreens
  when (screens /= dsbInfoScreens) $ do
      newHandles <- liftIO $ do
          hClose `mapM_` dsbInfoHandles
          cleanup
          mapM sb screens
      XS.put $ DynStatusBarInfo (zip screens newHandles)