From 0d8d8a768d3a0e6ebf879e0c672cd76f9b14216a Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Fri, 9 Mar 2007 04:56:15 +0100 Subject: use new StackSet api darcs-hash:20070309035615-9c5c1-db8a060d256336a54c76948c219d43ec39847628.gz --- WMonad.hs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'WMonad.hs') 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 -- cgit v1.2.3