diff options
author | Reto Hablützel <rethab@rethab.ch> | 2014-08-09 21:33:10 +0200 |
---|---|---|
committer | jao <jao@gnu.org> | 2014-08-09 23:18:46 +0200 |
commit | d9b24473ce65c6ce7f5bdea8c7d6eee07a62461e (patch) | |
tree | f748cd2c2f4df5753955a660044cf28a8737cb16 /src/Plugins/Monitors/Common.hs | |
parent | 35054d018c79d4b4da2dd93830dc351d28635242 (diff) | |
download | xmobar-d9b24473ce65c6ce7f5bdea8c7d6eee07a62461e.tar.gz xmobar-d9b24473ce65c6ce7f5bdea8c7d6eee07a62461e.tar.bz2 |
hlint refactorings
Diffstat (limited to 'src/Plugins/Monitors/Common.hs')
-rw-r--r-- | src/Plugins/Monitors/Common.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Plugins/Monitors/Common.hs b/src/Plugins/Monitors/Common.hs index 70f1b5f..1fd09a6 100644 --- a/src/Plugins/Monitors/Common.hs +++ b/src/Plugins/Monitors/Common.hs @@ -60,6 +60,7 @@ module Plugins.Monitors.Common ( ) where +import Control.Applicative ((<$>)) import Control.Monad.Reader import qualified Data.ByteString.Lazy.Char8 as B import Data.IORef @@ -112,7 +113,7 @@ mods s m = setConfigValue :: a -> Selector a -> Monitor () setConfigValue v s = - mods s (\_ -> v) + mods s (const v) getConfigValue :: Selector a -> Monitor a getConfigValue = sel @@ -342,7 +343,7 @@ combine m ((s,ts,ss):xs) = do next <- combine m xs str <- case Map.lookup ts m of Nothing -> return $ "<" ++ ts ++ ">" - Just r -> let f "" = r; f n = n; in fmap f $ parseTemplate' r m + Just r -> let f "" = r; f n = n; in f <$> parseTemplate' r m return $ s ++ str ++ ss ++ next -- $strings @@ -459,7 +460,7 @@ showVerticalBar v x = colorizeString v [convert $ 100 * x] | t <= 9600 = ' ' | t > 9608 = chr 9608 | otherwise = chr t - where t = 9600 + ((round val) `div` 12) + where t = 9600 + (round val `div` 12) showLogBar :: Float -> Float -> Monitor String showLogBar f v = do |