summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/Text
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-10-01 02:58:23 +0100
committerjao <jao@gnu.org>2022-10-01 02:58:23 +0100
commitac3b8212a68052f99eba2bd74a2dd8aa9ca2dcb2 (patch)
tree85900083aec42915c3ebab1af352f48ca4f690c6 /src/Xmobar/Text
parentef380c045957413948d390c152f6401869526285 (diff)
downloadxmobar-ac3b8212a68052f99eba2bd74a2dd8aa9ca2dcb2.tar.gz
xmobar-ac3b8212a68052f99eba2bd74a2dd8aa9ca2dcb2.tar.bz2
a couple of superfluous IO usages removed
Diffstat (limited to 'src/Xmobar/Text')
-rw-r--r--src/Xmobar/Text/Loop.hs2
-rw-r--r--src/Xmobar/Text/Output.hs8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/Xmobar/Text/Loop.hs b/src/Xmobar/Text/Loop.hs
index 05379cd..5d2c43f 100644
--- a/src/Xmobar/Text/Loop.hs
+++ b/src/Xmobar/Text/Loop.hs
@@ -45,4 +45,4 @@ eventLoop cfg signal tv = do
updateString :: Config -> TVar [String] -> IO String
updateString conf v = do
s <- readTVarIO v
- format conf (concat s)
+ return $ format conf (concat s)
diff --git a/src/Xmobar/Text/Output.hs b/src/Xmobar/Text/Output.hs
index 6e5b0f1..677b6d2 100644
--- a/src/Xmobar/Text/Output.hs
+++ b/src/Xmobar/Text/Output.hs
@@ -49,9 +49,9 @@ formatWithColor conf (Hspace n, i, x, y) =
formatWithColor conf (Text $ replicate (fromIntegral n) ' ', i, x, y)
formatWithColor _ _ = ""
-format :: Config -> String -> IO String
+format :: Config -> String -> String
format conf s = do
- segments <- parseString conf s
+ let segments = parseString conf s
case textOutputFormat conf of
- Swaybar -> return $ formatSwaybar conf segments
- _ -> return (concatMap (formatWithColor conf) segments)
+ Swaybar -> formatSwaybar conf segments
+ _ -> concatMap (formatWithColor conf) segments