mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-01 20:51:55 -07:00
add differentiate function to StackSet to go [a] -> Stack a.
This commit is contained in:
@@ -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
|
||||
@@ -262,6 +262,13 @@ integrate :: Stack a -> [a]
|
||||
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
|
||||
|
Reference in New Issue
Block a user