summaryrefslogtreecommitdiffstats
path: root/XMonad
diff options
context:
space:
mode:
authorSpencer Janssen <spencerjanssen@gmail.com>2008-09-11 23:48:03 +0200
committerSpencer Janssen <spencerjanssen@gmail.com>2008-09-11 23:48:03 +0200
commit10130d11f4a08aa23a960125b06eccf8532a10c1 (patch)
tree853934e985d79adab0928d1d94fbaea96ebad39e /XMonad
parentbfefeedb40f30db5142a31603a62def123cd1794 (diff)
downloadmetatile-10130d11f4a08aa23a960125b06eccf8532a10c1.tar
metatile-10130d11f4a08aa23a960125b06eccf8532a10c1.zip
Export focusUp' and focusDown' -- work entirely on stacks
darcs-hash:20080911214803-25a6b-9306a467197e471b957eb357c5740b0f585202bd
Diffstat (limited to 'XMonad')
-rw-r--r--XMonad/StackSet.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/XMonad/StackSet.hs b/XMonad/StackSet.hs
index bd1c4b6..eb5feb7 100644
--- a/XMonad/StackSet.hs
+++ b/XMonad/StackSet.hs
@@ -35,7 +35,7 @@ module XMonad.StackSet (
-- * Operations on the current stack
-- $stackOperations
peek, index, integrate, integrate', differentiate,
- focusUp, focusDown, focusMaster, focusWindow,
+ focusUp, focusDown, focusUp', focusDown', focusMaster, focusWindow,
tagMember, renameTag, ensureTags, member, findTag, mapWorkspace, mapLayout,
-- * Modifying the stackset
-- $modifyStackset
@@ -342,15 +342,19 @@ index = with [] integrate
--
focusUp, focusDown, swapUp, swapDown :: StackSet i l a s sd -> StackSet i l a s sd
focusUp = modify' focusUp'
-focusDown = modify' (reverseStack . focusUp' . reverseStack)
+focusDown = modify' focusDown'
swapUp = modify' swapUp'
swapDown = modify' (reverseStack . swapUp' . reverseStack)
-focusUp', swapUp' :: Stack a -> Stack a
+-- | Variants of 'focusUp' and 'focusDown' that work on a
+-- 'Stack' rather than an entire 'StackSet'.
+focusUp', focusDown' :: Stack a -> Stack a
focusUp' (Stack t (l:ls) rs) = Stack l ls (t:rs)
focusUp' (Stack t [] rs) = Stack x xs [] where (x:xs) = reverse (t:rs)
+focusDown' = reverseStack . focusUp' . reverseStack
+swapUp' :: Stack a -> Stack a
swapUp' (Stack t (l:ls) rs) = Stack t ls (l:rs)
swapUp' (Stack t [] rs) = Stack t (reverse rs) []