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/Util/Loggers.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'XMonad/Util/Loggers.hs') diff --git a/XMonad/Util/Loggers.hs b/XMonad/Util/Loggers.hs index 3c8c3ee..19e6eae 100644 --- a/XMonad/Util/Loggers.hs +++ b/XMonad/Util/Loggers.hs @@ -52,7 +52,9 @@ import XMonad.Hooks.DynamicLog import XMonad.Util.Font (Align (..)) import XMonad.Util.NamedWindows (getName) +import Prelude hiding (catch) import Control.Applicative ((<$>)) +import Control.Exception import Data.List (isPrefixOf, isSuffixOf) import Data.Maybe (fromMaybe) import Data.Traversable (traverse) @@ -62,6 +64,9 @@ import System.Locale import System.Process (runInteractiveCommand) import System.Time +econst :: Monad m => a -> IOException -> m a +econst = const . return + -- $usage -- Use this module by importing it into your @~\/.xmonad\/xmonad.hs@: -- @@ -138,7 +143,7 @@ loadAvg = logCmd "/usr/bin/uptime | sed 's/.*: //; s/,//g'" -- | Create a 'Logger' from an arbitrary shell command. logCmd :: String -> Logger logCmd c = io $ do (_, out, _, _) <- runInteractiveCommand c - fmap Just (hGetLine out) `catch` (const $ return Nothing) + fmap Just (hGetLine out) `catch` econst Nothing -- no need to waitForProcess, we ignore SIGCHLD -- | Get a count of filtered files in a directory. -- cgit v1.2.3