summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--StackSet.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/StackSet.hs b/StackSet.hs
index 99684ad..581eb0b 100644
--- a/StackSet.hs
+++ b/StackSet.hs
@@ -75,7 +75,7 @@
module StackSet (
StackSet(..), Workspace(..), Screen(..), Stack(..), RationalRect(..),
- new, view, lookupWorkspace, peek, index, integrate, focusUp, focusDown,
+ new, view, lookupWorkspace, peek, index, integrate, differentiate, focusUp, focusDown,
focusWindow, member, findIndex, insertUp, delete, shift, filter,
swapMaster, swapUp, swapDown, modify, float, sink -- needed by users
) where
@@ -263,6 +263,13 @@ integrate Empty = []
integrate (Node x l r) = reverse l ++ x : r
-- |
+-- /O(n)/. Texture a list.
+--
+differentiate :: [a] -> Stack a
+differentiate [] = Empty
+differentiate (x:xs) = Node x [] xs
+
+-- |
-- /O(n)/. 'filter p s' returns the elements of 's' such that 'p' evaluates to
-- True. Order is preserved, and focus moves to the next node to the right (if
-- necessary).