diff options
author | Don Stewart <dons@cse.unsw.edu.au> | 2007-03-09 04:56:15 +0100 |
---|---|---|
committer | Don Stewart <dons@cse.unsw.edu.au> | 2007-03-09 04:56:15 +0100 |
commit | 0d8d8a768d3a0e6ebf879e0c672cd76f9b14216a (patch) | |
tree | 63e3594d0e7816b843229b9a1b83257a76428fe4 /WMonad.hs | |
parent | cd4f1e1fb4904ec12fc57219e820afe323987d38 (diff) | |
download | xmonad-0d8d8a768d3a0e6ebf879e0c672cd76f9b14216a.tar.gz xmonad-0d8d8a768d3a0e6ebf879e0c672cd76f9b14216a.tar.xz xmonad-0d8d8a768d3a0e6ebf879e0c672cd76f9b14216a.zip |
use new StackSet api
darcs-hash:20070309035615-9c5c1-db8a060d256336a54c76948c219d43ec39847628.gz
Diffstat (limited to 'WMonad.hs')
-rw-r--r-- | WMonad.hs | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -16,7 +16,7 @@ module WMonad where -import StackSet +import StackSet (StackSet) import Control.Monad.State import System.IO @@ -87,11 +87,6 @@ modifyWorkspace f = do trace (show ws) -- log state changes to stderr -- | Run a side effecting action with the current workspace. Like 'when' but --- for (WorkSpace -> Maybe a). -whenJust :: (WorkSpace -> Maybe a) -> (a -> W ()) -> W () -whenJust mg f = do - ws <- gets workspace - case mg ws of - Nothing -> return () - Just w -> f w +whenJust :: Maybe a -> (a -> W ()) -> W () +whenJust mg f = maybe (return ()) f mg |