mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-04 06:01:53 -07:00
add differentiate function to StackSet to go [a] -> Stack a.
This commit is contained in:
@@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
module StackSet (
|
module StackSet (
|
||||||
StackSet(..), Workspace(..), Screen(..), Stack(..), RationalRect(..),
|
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,
|
focusWindow, member, findIndex, insertUp, delete, shift, filter,
|
||||||
swapMaster, swapUp, swapDown, modify, float, sink -- needed by users
|
swapMaster, swapUp, swapDown, modify, float, sink -- needed by users
|
||||||
) where
|
) where
|
||||||
@@ -262,6 +262,13 @@ integrate :: Stack a -> [a]
|
|||||||
integrate Empty = []
|
integrate Empty = []
|
||||||
integrate (Node x l r) = reverse l ++ x : r
|
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
|
-- /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
|
-- True. Order is preserved, and focus moves to the next node to the right (if
|
||||||
|
Reference in New Issue
Block a user