summaryrefslogtreecommitdiffhomepage
path: root/src/Plugins/Monitors/CpuFreq.hs
diff options
context:
space:
mode:
authorReto Hablützel <rethab@rethab.ch>2014-08-09 21:33:10 +0200
committerjao <jao@gnu.org>2014-08-09 23:18:46 +0200
commitd9b24473ce65c6ce7f5bdea8c7d6eee07a62461e (patch)
treef748cd2c2f4df5753955a660044cf28a8737cb16 /src/Plugins/Monitors/CpuFreq.hs
parent35054d018c79d4b4da2dd93830dc351d28635242 (diff)
downloadxmobar-d9b24473ce65c6ce7f5bdea8c7d6eee07a62461e.tar.gz
xmobar-d9b24473ce65c6ce7f5bdea8c7d6eee07a62461e.tar.bz2
hlint refactorings
Diffstat (limited to 'src/Plugins/Monitors/CpuFreq.hs')
-rw-r--r--src/Plugins/Monitors/CpuFreq.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Plugins/Monitors/CpuFreq.hs b/src/Plugins/Monitors/CpuFreq.hs
index 3fe2577..d3ecf89 100644
--- a/src/Plugins/Monitors/CpuFreq.hs
+++ b/src/Plugins/Monitors/CpuFreq.hs
@@ -24,8 +24,8 @@ import Plugins.Monitors.CoreCommon
cpuFreqConfig :: IO MConfig
cpuFreqConfig = mkMConfig
"Freq: <cpu0>" -- template
- (zipWith (++) (repeat "cpu") (map show [0 :: Int ..])) -- available
- -- replacements
+ (map ((++) "cpu" . show) [0 :: Int ..]) -- available
+ -- replacements
-- |
-- Function retrieves monitor string holding the cpu frequency (or frequencies)
@@ -33,7 +33,7 @@ runCpuFreq :: [String] -> Monitor String
runCpuFreq _ = do
let path = ["/sys/devices/system/cpu/cpu", "/cpufreq/scaling_cur_freq"]
divisor = 1e6 :: Double
- fmt x | x < 1 = (show (round (x * 1000) :: Integer)) ++ "MHz"
- | otherwise = (show x) ++ "GHz"
+ fmt x | x < 1 = show (round (x * 1000) :: Integer) ++ "MHz"
+ | otherwise = show x ++ "GHz"
failureMessage <- getConfigValue naString
checkedDataRetrieval failureMessage [path] Nothing (/divisor) fmt