summaryrefslogtreecommitdiffhomepage
path: root/src/Plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/Plugins')
-rw-r--r--src/Plugins/MBox.hs6
-rw-r--r--src/Plugins/Monitors.hs5
-rw-r--r--src/Plugins/Monitors/CoreCommon.hs2
-rw-r--r--src/Plugins/StdinReader.hs8
4 files changed, 11 insertions, 10 deletions
diff --git a/src/Plugins/MBox.hs b/src/Plugins/MBox.hs
index 65a8bb3..c4335f7 100644
--- a/src/Plugins/MBox.hs
+++ b/src/Plugins/MBox.hs
@@ -14,13 +14,13 @@
module Plugins.MBox (MBox(..)) where
-import Prelude hiding (catch)
+import Prelude
import Plugins
import Plugins.Utils (changeLoop, expandHome)
import Control.Monad (when)
import Control.Concurrent.STM
-import Control.Exception (SomeException, handle, evaluate)
+import Control.Exception (SomeException (..), handle, evaluate)
import System.Console.GetOpt
import System.Directory (doesFileExist)
@@ -99,7 +99,7 @@ showC u m n c =
countMails :: FilePath -> IO Int
countMails f =
- handle ((\_ -> evaluate 0) :: SomeException -> IO Int)
+ handle (\(SomeException _) -> evaluate 0)
(do txt <- B.readFile f
evaluate $! length . filter (B.isPrefixOf from) . B.lines $ txt)
where from = B.pack "From "
diff --git a/src/Plugins/Monitors.hs b/src/Plugins/Monitors.hs
index 009da68..8d5ac35 100644
--- a/src/Plugins/Monitors.hs
+++ b/src/Plugins/Monitors.hs
@@ -3,7 +3,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Xmobar.Plugins.Monitors
--- Copyright : (c) 2010, 2011 Jose Antonio Ortega Ruiz
+-- Copyright : (c) 2010, 2011, 2012 Jose Antonio Ortega Ruiz
-- (c) 2007-10 Andrea Rossato
-- License : BSD-style (see LICENSE)
--
@@ -19,7 +19,7 @@ module Plugins.Monitors where
import Plugins
-import Plugins.Monitors.Common ( runM, runMB )
+import Plugins.Monitors.Common (runM)
import Plugins.Monitors.Weather
import Plugins.Monitors.Net
import Plugins.Monitors.Mem
@@ -40,6 +40,7 @@ import Plugins.Monitors.Wireless
#endif
#ifdef LIBMPD
import Plugins.Monitors.MPD
+import Plugins.Monitors.Common (runMB)
#endif
#ifdef ALSA
import Plugins.Monitors.Volume
diff --git a/src/Plugins/Monitors/CoreCommon.hs b/src/Plugins/Monitors/CoreCommon.hs
index a18697f..c7fb7d5 100644
--- a/src/Plugins/Monitors/CoreCommon.hs
+++ b/src/Plugins/Monitors/CoreCommon.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE PatternGuards, CPP #-}
+{-# LANGUAGE PatternGuards #-}
-----------------------------------------------------------------------------
-- |
diff --git a/src/Plugins/StdinReader.hs b/src/Plugins/StdinReader.hs
index 935d76a..fddd0bc 100644
--- a/src/Plugins/StdinReader.hs
+++ b/src/Plugins/StdinReader.hs
@@ -14,11 +14,11 @@
module Plugins.StdinReader where
-import Prelude hiding (catch)
+import Prelude
import System.Posix.Process
import System.Exit
import System.IO
-import Control.Exception (SomeException(..),catch)
+import Control.Exception (SomeException(..), handle)
import Plugins
data StdinReader = StdinReader
@@ -26,8 +26,8 @@ data StdinReader = StdinReader
instance Exec StdinReader where
start StdinReader cb = do
- cb =<< catch (hGetLineSafe stdin)
- (\(SomeException e) -> do hPrint stderr e; return "")
+ cb =<< handle (\(SomeException e) -> do hPrint stderr e; return "")
+ (hGetLineSafe stdin)
eof <- hIsEOF stdin
if eof
then exitImmediately ExitSuccess