aboutsummaryrefslogtreecommitdiffstats
path: root/DynamicLog.hs
diff options
context:
space:
mode:
authorShachaf Ben-Kiki <shachaf@gmail.com>2007-06-20 03:10:16 +0200
committerShachaf Ben-Kiki <shachaf@gmail.com>2007-06-20 03:10:16 +0200
commit6dc189877f29fb098d8a16e3cddde8b4726bf98d (patch)
tree043558e32368d2d907d48095486c8870b6782995 /DynamicLog.hs
parent346cc3269ee31062fa7eb560f90c4059c6279962 (diff)
downloadXMonadContrib-6dc189877f29fb098d8a16e3cddde8b4726bf98d.tar.gz
XMonadContrib-6dc189877f29fb098d8a16e3cddde8b4726bf98d.tar.xz
XMonadContrib-6dc189877f29fb098d8a16e3cddde8b4726bf98d.zip
Use Data.Ord.comparing in DynamicLog
This patch replaces (compare `on`) with Data.ord.comparing, so on doesn't have to be defined. darcs-hash:20070620011016-bffde-57b2a58458e443cf8cbe0af51130ea99289650d2.gz
Diffstat (limited to 'DynamicLog.hs')
-rw-r--r--DynamicLog.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/DynamicLog.hs b/DynamicLog.hs
index 297d907..c6b3b5a 100644
--- a/DynamicLog.hs
+++ b/DynamicLog.hs
@@ -30,6 +30,7 @@ module XMonadContrib.DynamicLog (
import XMonad
import Data.Maybe ( isJust )
import Data.List
+import Data.Ord ( comparing )
import qualified StackSet as S
-- $usage
@@ -55,7 +56,7 @@ dynamicLog :: X ()
dynamicLog = withWindowSet $ io . putStrLn . pprWindowSet
pprWindowSet :: WindowSet -> String
-pprWindowSet s = concatMap fmt $ sortBy (compare `on` S.tag)
+pprWindowSet s = concatMap fmt $ sortBy (comparing S.tag)
(map S.workspace (S.current s : S.visible s) ++ S.hidden s)
where this = S.tag (S.workspace (S.current s))
visibles = map (S.tag . S.workspace) (S.visible s)
@@ -79,13 +80,10 @@ dynamicLogXinerama = withWindowSet $ io . putStrLn . pprWindowSetXinerama
pprWindowSetXinerama :: WindowSet -> String
pprWindowSetXinerama ws = "[" ++ unwords onscreen ++ "] " ++ unwords offscreen
where onscreen = map (pprTag . S.workspace)
- . sortBy (compare `on` S.screen) $ S.current ws : S.visible ws
+ . sortBy (comparing S.screen) $ S.current ws : S.visible ws
offscreen = map pprTag . filter (isJust . S.stack)
- . sortBy (compare `on` S.tag) $ S.hidden ws
+ . sortBy (comparing S.tag) $ S.hidden ws
-- util functions
pprTag :: Integral i => S.Workspace i a -> String
pprTag = show . (+(1::Int)) . fromIntegral . S.tag
-
-on :: (a -> a -> c) -> (b -> a) -> b -> b -> c
-on f g a b = (g a) `f` (g b)