summaryrefslogtreecommitdiffhomepage
path: root/src/Plugins/Monitors
diff options
context:
space:
mode:
authorJohn Tyree <johntyree@gmail.com>2013-04-20 21:07:19 +0200
committerJohn Tyree <johntyree@gmail.com>2013-04-20 21:07:19 +0200
commitf1bdd8115f201be09f60d77699048b9dac3e5950 (patch)
tree340d2089ed65bb05d6f6ee0cbefb4d9a4bec5d48 /src/Plugins/Monitors
parent3ddada25d66d3254376c3bb2cba33925221da788 (diff)
downloadxmobar-f1bdd8115f201be09f60d77699048b9dac3e5950.tar.gz
xmobar-f1bdd8115f201be09f60d77699048b9dac3e5950.tar.bz2
Use intercalate instead of explicit foldl
Diffstat (limited to 'src/Plugins/Monitors')
-rw-r--r--src/Plugins/Monitors/MPD.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Plugins/Monitors/MPD.hs b/src/Plugins/Monitors/MPD.hs
index 450ad8f..96a8f1d 100644
--- a/src/Plugins/Monitors/MPD.hs
+++ b/src/Plugins/Monitors/MPD.hs
@@ -14,6 +14,7 @@
module Plugins.Monitors.MPD ( mpdConfig, runMPD, mpdWait ) where
+import Data.List
import Plugins.Monitors.Common
import System.Console.GetOpt
import qualified Network.MPD as M
@@ -93,9 +94,7 @@ parseSong :: M.Response (Maybe M.Song) -> Monitor [String]
parseSong (Left _) = return $ repeat ""
parseSong (Right Nothing) = return $ repeat ""
parseSong (Right (Just s)) =
- let join [] = ""
- join (x:xs) = foldl (\a o -> a ++ ", " ++ o) x xs
- str sel = maybe "" (join . map M.toString) (M.sgGetTag sel s)
+ let str sel = maybe "" (intercalate ", " . map M.toString) (M.sgGetTag sel s)
sels = [ M.Name, M.Artist, M.Composer, M.Performer
, M.Album, M.Title, M.Track, M.Genre ]
fields = M.toString (M.sgFilePath s) : map str sels