[taffybar] Use sequence for swapping IO and Maybe
This commit is contained in:
		| @@ -125,8 +125,6 @@ getInterfaces = do | |||||||
|   (_, output, _) <- readCreateProcessWithExitCode (shell "list_interfaces.sh") "" |   (_, output, _) <- readCreateProcessWithExitCode (shell "list_interfaces.sh") "" | ||||||
|   return $ splitOn "\n" output |   return $ splitOn "\n" output | ||||||
|  |  | ||||||
| swapMaybeIO = maybe (return Nothing) (Just <$>) |  | ||||||
|  |  | ||||||
| main = do | main = do | ||||||
|   monEither <- |   monEither <- | ||||||
|     (try $ getEnv "TAFFYBAR_MONITOR") :: IO (Either SomeException String) |     (try $ getEnv "TAFFYBAR_MONITOR") :: IO (Either SomeException String) | ||||||
| @@ -149,7 +147,7 @@ main = do | |||||||
|          cfg <- asks hudConfig |          cfg <- asks hudConfig | ||||||
|          lift $ do |          lift $ do | ||||||
|            img <- Gtk.imageNew |            img <- Gtk.imageNew | ||||||
|            pb <- swapMaybeIO $ getWorkspacePixBuf (windowIconSize cfg) ws |            pb <- sequence $ getWorkspacePixBuf (windowIconSize cfg) ws | ||||||
|            setImage (windowIconSize cfg) img pb |            setImage (windowIconSize cfg) img pb | ||||||
|            return $ WWC ConstantIconController { cicImage = img } |            return $ WWC ConstantIconController { cicImage = img } | ||||||
|       makeIcon = return . IIFilePath . inResourcesDirectory |       makeIcon = return . IIFilePath . inResourcesDirectory | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user