From 39f010d82d0292d9417a06abaf91dabb43ea3ef4 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Sun, 31 Jul 2011 19:08:50 +0200 Subject: GHC 7 compat Ignore-this: 17a43a709e70ebccc925e016d7057399 * true error: more modules export foldl/foldl'/foldr, so explicitly use the Data.Foldable one * -Werror error: transition from Control.OldException to Control.Exception, assuming everything was IOException darcs-hash:20110731170850-76d51-71271524485f6d10f84521f271182bea5085d400.gz --- XMonad/Layout/WorkspaceDir.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'XMonad/Layout/WorkspaceDir.hs') diff --git a/XMonad/Layout/WorkspaceDir.hs b/XMonad/Layout/WorkspaceDir.hs index 775653b..ffffded 100644 --- a/XMonad/Layout/WorkspaceDir.hs +++ b/XMonad/Layout/WorkspaceDir.hs @@ -28,6 +28,8 @@ module XMonad.Layout.WorkspaceDir ( changeDir ) where +import Prelude hiding (catch) +import Control.Exception import System.Directory ( setCurrentDirectory, getCurrentDirectory ) import Control.Monad ( when ) @@ -38,6 +40,9 @@ import XMonad.Prompt.Directory ( directoryPrompt ) import XMonad.Layout.LayoutModifier import XMonad.StackSet ( tag, currentTag ) +econst :: Monad m => a -> IOException -> m a +econst = const . return + -- $usage -- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@: -- @@ -84,7 +89,7 @@ cleanDir :: String -> X String cleanDir x = scd x >> io getCurrentDirectory scd :: String -> X () -scd x = do x' <- io (runProcessWithInput "bash" [] ("echo -n " ++ x) `catch` \_ -> return x) +scd x = do x' <- io (runProcessWithInput "bash" [] ("echo -n " ++ x) `catch` econst x) catchIO $ setCurrentDirectory x' changeDir :: XPConfig -> X () -- cgit v1.2.3