diff options
author | Adam Vogt <vogt.adam@gmail.com> | 2010-02-22 16:17:10 +0100 |
---|---|---|
committer | Adam Vogt <vogt.adam@gmail.com> | 2010-02-22 16:17:10 +0100 |
commit | 7d085e2c29b8195b6dcf4b2459b2a4f3664499ad (patch) | |
tree | 7144ec7555855e9a3d4472b67084c4c23217646d /XMonad | |
parent | 81d41cb66eb23fe4fbdbfe930c2eb90a10b08fb7 (diff) | |
download | XMonadContrib-7d085e2c29b8195b6dcf4b2459b2a4f3664499ad.tar.gz XMonadContrib-7d085e2c29b8195b6dcf4b2459b2a4f3664499ad.tar.xz XMonadContrib-7d085e2c29b8195b6dcf4b2459b2a4f3664499ad.zip |
Use more monoid instances to clean up U.WorkspaceCompare
Ignore-this: ab7089175a7486144e01b706de04036e
darcs-hash:20100222151710-1499c-e42b819bc146570ed3dd8127d580ab4fc9f2688f.gz
Diffstat (limited to 'XMonad')
-rw-r--r-- | XMonad/Util/WorkspaceCompare.hs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/XMonad/Util/WorkspaceCompare.hs b/XMonad/Util/WorkspaceCompare.hs index 6b4ba54..66e401e 100644 --- a/XMonad/Util/WorkspaceCompare.hs +++ b/XMonad/Util/WorkspaceCompare.hs @@ -28,6 +28,7 @@ import Data.List import Data.Monoid import Data.Ord import Data.Maybe +import Data.Function type WorkspaceCompare = WorkspaceId -> WorkspaceId -> Ordering type WorkspaceSort = [WindowSpace] -> [WindowSpace] @@ -44,12 +45,7 @@ getWsIndex = do getWsCompare :: X WorkspaceCompare getWsCompare = do wsIndex <- getWsIndex - return $ \a b -> f (wsIndex a) (wsIndex b) `mappend` compare a b - where - f Nothing Nothing = EQ - f (Just _) Nothing = LT - f Nothing (Just _) = GT - f (Just x) (Just y) = compare x y + return $ mconcat [compare `on` wsIndex, compare] -- | A simple comparison function that orders workspaces -- lexicographically by tag. |