From 80c414ffdec4bfcfb9c583264643176fba2ef3df Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Sat, 22 Dec 2007 11:50:45 +0100 Subject: A few short comments for WorkspaceCompare darcs-hash:20071222105045-a5988-775e0ca1c62a7f1db386bdb739d4c0aad635862a.gz --- XMonad/Util/WorkspaceCompare.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'XMonad/Util/WorkspaceCompare.hs') diff --git a/XMonad/Util/WorkspaceCompare.hs b/XMonad/Util/WorkspaceCompare.hs index 93bd597..bba9ebe 100644 --- a/XMonad/Util/WorkspaceCompare.hs +++ b/XMonad/Util/WorkspaceCompare.hs @@ -16,11 +16,14 @@ import qualified XMonad.StackSet as S import Data.List import Data.Monoid +-- | Lookup the index of a workspace id in the user's config, return Nothing +-- if that workspace does not exist in the config. getWsIndex :: X (WorkspaceId -> Maybe Int) getWsIndex = do spaces <- asks (workspaces . config) return $ flip elemIndex spaces +-- | A comparison function for WorkspaceId getWsCompare :: X (WorkspaceId -> WorkspaceId -> Ordering) getWsCompare = do wsIndex <- getWsIndex @@ -31,6 +34,7 @@ getWsCompare = do f Nothing (Just _) = GT f (Just x) (Just y) = compare x y +-- | Sort several workspaces according to the order in getWsCompare getSortByTag :: X ([WindowSpace] -> [WindowSpace]) getSortByTag = do cmp <- getWsCompare -- cgit v1.2.3