summaryrefslogtreecommitdiffstats
path: root/StackSet.hs
diff options
context:
space:
mode:
authorDon Stewart <dons@cse.unsw.edu.au>2007-04-11 10:15:00 +0200
committerDon Stewart <dons@cse.unsw.edu.au>2007-04-11 10:15:00 +0200
commit4ff0c6bda87f4ca82d2c5e3e78f8e7cfc20f3302 (patch)
treead0decc6f9409b8b4e136c9d223d3ed79bc99e16 /StackSet.hs
parent344921c2341f5e2d87720ee4c047730ae78081a3 (diff)
downloadmetatile-4ff0c6bda87f4ca82d2c5e3e78f8e7cfc20f3302.tar
metatile-4ff0c6bda87f4ca82d2c5e3e78f8e7cfc20f3302.zip
and the tests still run
darcs-hash:20070411081500-9c5c1-de5c90255b488c617bee222ece8e4ff059a8a95a
Diffstat (limited to 'StackSet.hs')
-rw-r--r--StackSet.hs19
1 files changed, 5 insertions, 14 deletions
diff --git a/StackSet.hs b/StackSet.hs
index 39e2000..89a8484 100644
--- a/StackSet.hs
+++ b/StackSet.hs
@@ -1,3 +1,4 @@
+{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
-- |
-- Module : StackSet
@@ -14,9 +15,10 @@
-- set is always current. Elements may appear only once in the entire
-- stack set.
--
--- A StackSet provides a nice data structure for multiscreen
--- window managers, where each screen has a stack of windows, and a window
--- may be on only 1 screen at any given time.
+-- A StackSet provides a nice data structure for window managers with
+-- multiple physical screens, and multiple workspaces, where each screen
+-- has a stack of windows, and a window may be on only 1 screen at any
+-- given time.
--
module StackSet where
@@ -27,11 +29,6 @@ import qualified Data.Map as M
------------------------------------------------------------------------
---
--- N.B we probably want to think about strict 'adjust' and inserts on
--- these data structures in the long run.
---
-
-- | The StackSet data structure. A table of stacks, with a current pointer
data StackSet a =
StackSet
@@ -226,12 +223,6 @@ promote w = w { stacks = M.adjust next (current w) (stacks w) }
where next [] = []
next xs = last xs : init xs
---
--- case M.lookup k (cache w) of
--- Nothing -> w
--- Just i -> w { stacks = M.adjust (\ks -> k : filter (/= k) ks) i (stacks w) }
---
-
-- |
elemAfter :: Eq a => a -> [a] -> Maybe a
elemAfter w ws = listToMaybe . filter (/= w) . dropWhile (/= w) $ ws ++ ws