From 2991a3c18b00bb41197e6a688c4ce07ad52057c0 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Mon, 4 Feb 2013 01:15:40 +0100 Subject: Removing uneeded uses of hiding (catch) --- src/Plugins/Mail.hs | 1 - src/Plugins/Monitors/Volume.hs | 11 +++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/Plugins') diff --git a/src/Plugins/Mail.hs b/src/Plugins/Mail.hs index b11b7ad..d146d17 100644 --- a/src/Plugins/Mail.hs +++ b/src/Plugins/Mail.hs @@ -14,7 +14,6 @@ module Plugins.Mail where -import Prelude hiding (catch) import Plugins import Plugins.Utils (expandHome, changeLoop) diff --git a/src/Plugins/Monitors/Volume.hs b/src/Plugins/Monitors/Volume.hs index 23dc348..f3d0f4c 100644 --- a/src/Plugins/Monitors/Volume.hs +++ b/src/Plugins/Monitors/Volume.hs @@ -19,7 +19,7 @@ import Control.Monad ( join, liftM2, liftM3, mplus ) import Data.Traversable (sequenceA) import Plugins.Monitors.Common import Sound.ALSA.Mixer -import Sound.ALSA.Exception ( catch ) +import qualified Sound.ALSA.Exception as AE import System.Console.GetOpt volumeConfig :: IO MConfig @@ -124,10 +124,12 @@ runVolume mixerName controlName argv = do where volumeControl :: Maybe Control -> Maybe Volume - volumeControl c = join $ (playback . volume <$> c) `mplus` (common . volume <$> c) + volumeControl c = join $ + (playback . volume <$> c) `mplus` (common . volume <$> c) switchControl :: Maybe Control -> Maybe Switch - switchControl c = join $ (playback . switch <$> c) `mplus` (common . switch <$> c) + switchControl c = join $ + (playback . switch <$> c) `mplus` (common . switch <$> c) liftMaybe :: Maybe (IO (a,b)) -> IO (Maybe a, Maybe b) liftMaybe = fmap (liftM2 (,) (fmap fst) (fmap snd)) . sequenceA @@ -138,7 +140,8 @@ runVolume mixerName controlName argv = do getDB :: Maybe Volume -> Monitor (Maybe Integer) getDB Nothing = return Nothing - getDB (Just v) = io $ catch (getChannel FrontLeft $ dB v) (const $ return $ Just 0) + getDB (Just v) = io $ AE.catch (getChannel FrontLeft $ dB v) + (const $ return $ Just 0) getVal :: Maybe Volume -> Monitor (Maybe Integer) getVal Nothing = return Nothing -- cgit v1.2.3