aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Actions
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2008-04-08 23:00:50 +0200
committerSpencer Janssen <sjanssen@cse.unl.edu>2008-04-08 23:00:50 +0200
commit5de283ea52fe312627ad01485d8267206095e11a (patch)
treed70f74abc1dbf5fcd31e270def443ce00c4a7f3b /XMonad/Actions
parent219295d64e15758d47f06eb6da5734687081c829 (diff)
downloadXMonadContrib-5de283ea52fe312627ad01485d8267206095e11a.tar.gz
XMonadContrib-5de283ea52fe312627ad01485d8267206095e11a.tar.xz
XMonadContrib-5de283ea52fe312627ad01485d8267206095e11a.zip
Generalize copyWindow, minor style change
darcs-hash:20080408210050-a5988-31d139d44b1207465d07b8c79e141c5eb79e157d.gz
Diffstat (limited to 'XMonad/Actions')
-rw-r--r--XMonad/Actions/CopyWindow.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/XMonad/Actions/CopyWindow.hs b/XMonad/Actions/CopyWindow.hs
index 1fcbdb3..acd5a63 100644
--- a/XMonad/Actions/CopyWindow.hs
+++ b/XMonad/Actions/CopyWindow.hs
@@ -65,16 +65,16 @@ import XMonad.StackSet
-- "XMonad.Doc.Extending#Editing_key_bindings".
-- | copy. Copy the focussed window to a new workspace.
-copy :: WorkspaceId -> WindowSet -> WindowSet
+copy :: (Eq s, Eq i, Eq a) => i -> StackSet i l a s sd -> StackSet i l a s sd
copy n s | Just w <- peek s = copyWindow w n s
| otherwise = s
-- | copyToAll. Copy the focused window to all of workspaces.
-copyToAll :: WindowSet -> WindowSet
-copyToAll s = foldr ($) s $ map (copy . tag) (workspaces s)
+copyToAll :: (Eq s, Eq i, Eq a) => StackSet i l a s sd -> StackSet i l a s sd
+copyToAll s = foldr copy s $ map tag (workspaces s)
-- | copyWindow. Copy a window to a new workspace
-copyWindow :: Window -> WorkspaceId -> WindowSet -> WindowSet
+copyWindow :: (Eq a, Eq i, Eq s) => a -> i -> StackSet i l a s sd -> StackSet i l a s sd
copyWindow w n = copy'
where copy' s = if n `tagMember` s
then view (tag (workspace (current s))) $ insertUp' w $ view n s