From b30fe4409e50f05f90d050da8dc372e23c60edde Mon Sep 17 00:00:00 2001 From: Jason Creighton Date: Sun, 18 Mar 2007 00:49:04 +0100 Subject: basic xinerama support (depends on Graphics.X11.Xinerama in X11-extras) darcs-hash:20070317234904-b9aa7-ef29cf597970298a24d770ec789f83638390d22a.gz --- StackSet.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'StackSet.hs') 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 -- cgit v1.2.3