From 2b22daa5d57a04d2a3e04b1c7260d835262b2f20 Mon Sep 17 00:00:00 2001 From: Devin Mullins Date: Sat, 6 Oct 2007 07:54:04 +0200 Subject: get rid of duplicate mapWorkspaces function darcs-hash:20071006055404-78224-0f63ff465b5f34f67cfd3ce8466441680fb7714d.gz --- SwapWorkspaces.hs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'SwapWorkspaces.hs') diff --git a/SwapWorkspaces.hs b/SwapWorkspaces.hs index 4b404b6..0dbcfb1 100644 --- a/SwapWorkspaces.hs +++ b/SwapWorkspaces.hs @@ -45,13 +45,7 @@ swapWithCurrent t s = swapWorkspaces t (tag $ workspace $ current s) s -- Stole this from StackSet.renameTag -- extracted the traversal code they have in common as mapWorkspaces swapWorkspaces :: Eq i => i -> i -> StackSet i l a s sd -> StackSet i l a s sd -swapWorkspaces t1 t2 = mapWorkspaces swap +swapWorkspaces t1 t2 = mapWorkspace swap where swap w = if tag w == t1 then w { tag = t2 } else if tag w == t2 then w { tag = t1 } else w - -mapWorkspaces :: (Workspace i l a -> Workspace i l a) -> StackSet i l a s sd -> StackSet i l a s sd -mapWorkspaces f s = s { current = updScr $ current s - , visible = map updScr $ visible s - , hidden = map f $ hidden s } - where updScr scr = scr { workspace = f $ workspace scr } -- cgit v1.2.3