aboutsummaryrefslogtreecommitdiffstats
path: root/StackSet.hs
diff options
context:
space:
mode:
authorJason Creighton <jcreigh@gmail.com>2007-03-18 00:49:04 +0100
committerJason Creighton <jcreigh@gmail.com>2007-03-18 00:49:04 +0100
commitb30fe4409e50f05f90d050da8dc372e23c60edde (patch)
treed4c4759fde1bc0c5cf7827a46def25c22d5b4fff /StackSet.hs
parentba0ef429ec9086f7e3efdd31b72f9bd346b9000e (diff)
downloadxmonad-b30fe4409e50f05f90d050da8dc372e23c60edde.tar.gz
xmonad-b30fe4409e50f05f90d050da8dc372e23c60edde.tar.xz
xmonad-b30fe4409e50f05f90d050da8dc372e23c60edde.zip
basic xinerama support (depends on Graphics.X11.Xinerama in X11-extras)
darcs-hash:20070317234904-b9aa7-ef29cf597970298a24d770ec789f83638390d22a.gz
Diffstat (limited to 'StackSet.hs')
-rw-r--r--StackSet.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/StackSet.hs b/StackSet.hs
index 15788bc..1453c97 100644
--- a/StackSet.hs
+++ b/StackSet.hs
@@ -61,6 +61,10 @@ empty n = StackSet { current = 0
member :: Ord a => a -> StackSet a -> Bool
member a w = M.member a (cache w)
+-- | /O(log n)/. Looks up the stack that x is in, if it is in the StackSet
+lookup :: (Monad m, Ord a) => a -> StackSet a -> m Int
+lookup x w = M.lookup x (cache w)
+
-- | /O(n)/. Number of stacks
size :: StackSet a -> Int
size = M.size . stacks