GHC 7 compat

* 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
This commit is contained in:
Daniel Wagner
2011-07-31 17:08:50 +00:00
parent 1364a00c84
commit 2443a962a0
10 changed files with 61 additions and 18 deletions

View File

@@ -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 ()