aboutsummaryrefslogtreecommitdiffstats
path: root/WMonad.hs
diff options
context:
space:
mode:
authorDon Stewart <dons@cse.unsw.edu.au>2007-03-09 04:56:15 +0100
committerDon Stewart <dons@cse.unsw.edu.au>2007-03-09 04:56:15 +0100
commit0d8d8a768d3a0e6ebf879e0c672cd76f9b14216a (patch)
tree63e3594d0e7816b843229b9a1b83257a76428fe4 /WMonad.hs
parentcd4f1e1fb4904ec12fc57219e820afe323987d38 (diff)
downloadxmonad-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.hs11
1 files changed, 3 insertions, 8 deletions
diff --git a/WMonad.hs b/WMonad.hs
index e059066..583f805 100644
--- a/WMonad.hs
+++ b/WMonad.hs
@@ -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