mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-02 13:11:53 -07:00
Add integrate
This commit is contained in:
@@ -76,7 +76,7 @@
|
|||||||
--
|
--
|
||||||
module StackSet (
|
module StackSet (
|
||||||
StackSet(..), Workspace(..), Screen(..), Stack(..), RationalRect(..),
|
StackSet(..), Workspace(..), Screen(..), Stack(..), RationalRect(..),
|
||||||
new, view, lookupWorkspace, peek, index, focusUp, focusDown,
|
new, view, lookupWorkspace, peek, index, integrate, focusUp, focusDown,
|
||||||
focusWindow, member, findIndex, insertUp, delete, shift,
|
focusWindow, member, findIndex, insertUp, delete, shift,
|
||||||
swapMaster, swapUp, swapDown, modify, float, sink -- needed by users
|
swapMaster, swapUp, swapDown, modify, float, sink -- needed by users
|
||||||
) where
|
) where
|
||||||
@@ -243,6 +243,13 @@ modify d f s = s { current = (current s)
|
|||||||
peek :: StackSet i a s -> Maybe a
|
peek :: StackSet i a s -> Maybe a
|
||||||
peek = with Nothing (return . focus)
|
peek = with Nothing (return . focus)
|
||||||
|
|
||||||
|
--
|
||||||
|
-- /O(n)/. Flatten a Stack into a list.
|
||||||
|
--
|
||||||
|
integrate :: Stack a -> [a]
|
||||||
|
integrate Empty = []
|
||||||
|
integrate (Node x l r) = reverse l ++ x : r
|
||||||
|
|
||||||
--
|
--
|
||||||
-- /O(s)/. Extract the stack on the current workspace, as a list.
|
-- /O(s)/. Extract the stack on the current workspace, as a list.
|
||||||
-- The order of the stack is determined by the master window -- it will be
|
-- The order of the stack is determined by the master window -- it will be
|
||||||
|
Reference in New Issue
Block a user