summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2012-10-06 22:39:56 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2012-10-06 22:39:56 +0200
commitcbc0c9ac5219182ccd384eb5a4bbf3c4cad4f446 (patch)
tree2fdd81bf8607bbd75653571fd4a575467e175f8d
parenta01c73f820813ad0c9459ecf1465cdc99093ee27 (diff)
downloadxmobar-cbc0c9ac5219182ccd384eb5a4bbf3c4cad4f446.tar.gz
xmobar-cbc0c9ac5219182ccd384eb5a4bbf3c4cad4f446.tar.bz2
Not using deprecated `catch` in Prelude
-rw-r--r--src/Plugins/Monitors/Bright.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Plugins/Monitors/Bright.hs b/src/Plugins/Monitors/Bright.hs
index 107bd89..0679ab8 100644
--- a/src/Plugins/Monitors/Bright.hs
+++ b/src/Plugins/Monitors/Bright.hs
@@ -14,6 +14,7 @@
module Plugins.Monitors.Bright (brightConfig, runBright) where
+import Control.Exception (SomeException, handle)
import qualified Data.ByteString.Lazy.Char8 as B
import Data.Char
import System.FilePath ((</>))
@@ -88,7 +89,8 @@ readBright files = do
currVal<- grab $ (fCurr files)
maxVal <- grab $ (fMax files)
return $ (currVal / maxVal)
- where grab f = catch (fmap (read . B.unpack) $ B.readFile f)(\_ -> return 0)
+ where grab f = handle handler (fmap (read . B.unpack) $ B.readFile f)
+ handler = const (return 0) :: SomeException -> IO Float
showHorizontalBar :: Float -> Monitor String
showHorizontalBar x = do