mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-16 12:33:47 -07:00
comments
This commit is contained in:
@@ -67,14 +67,15 @@ trace msg = io $ do
|
|||||||
hPutStrLn stderr msg
|
hPutStrLn stderr msg
|
||||||
hFlush stderr
|
hFlush stderr
|
||||||
|
|
||||||
-- | Modify the workspace list
|
-- | Modify the workspace list.
|
||||||
modifyWorkspace :: (WorkSpace -> WorkSpace) -> W ()
|
modifyWorkspace :: (WorkSpace -> WorkSpace) -> W ()
|
||||||
modifyWorkspace f = do
|
modifyWorkspace f = do
|
||||||
modify $ \s -> s { workspace = f (workspace s) }
|
modify $ \s -> s { workspace = f (workspace s) }
|
||||||
ws <- gets workspace
|
ws <- gets workspace
|
||||||
trace (show $ ws)
|
trace (show ws) -- log state changes to stderr
|
||||||
|
|
||||||
-- | Like 'when' but for (WorkSpace -> Maybe a)
|
-- | Run a side effecting action with the current workspace. Like 'when' but
|
||||||
|
-- for (WorkSpace -> Maybe a).
|
||||||
whenJust :: (WorkSpace -> Maybe a) -> (a -> W ()) -> W ()
|
whenJust :: (WorkSpace -> Maybe a) -> (a -> W ()) -> W ()
|
||||||
whenJust mg f = do
|
whenJust mg f = do
|
||||||
ws <- gets workspace
|
ws <- gets workspace
|
||||||
|
Reference in New Issue
Block a user