diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2013-02-04 01:15:40 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2013-02-04 01:15:40 +0100 |
commit | 2991a3c18b00bb41197e6a688c4ce07ad52057c0 (patch) | |
tree | 7e1b2314940b9c62ce474fd14901b6c24732195e /src/Plugins/Monitors | |
parent | fdc91a62c37bd475440bee275e6b0329833f6af4 (diff) | |
download | xmobar-2991a3c18b00bb41197e6a688c4ce07ad52057c0.tar.gz xmobar-2991a3c18b00bb41197e6a688c4ce07ad52057c0.tar.bz2 |
Removing uneeded uses of hiding (catch)
Diffstat (limited to 'src/Plugins/Monitors')
-rw-r--r-- | src/Plugins/Monitors/Volume.hs | 11 |
1 files changed, 7 insertions, 4 deletions
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 |