aboutsummaryrefslogtreecommitdiffstats
path: root/StackSet.hs
diff options
context:
space:
mode:
authorDon Stewart <dons@cse.unsw.edu.au>2007-04-29 05:58:04 +0200
committerDon Stewart <dons@cse.unsw.edu.au>2007-04-29 05:58:04 +0200
commitbd91b7ae4362dc3f07bfc30dd946bfcaa9ea9812 (patch)
treeb1ec6aababd481bd4cc87766eeea7ff7bafc9e18 /StackSet.hs
parent8fb8058a6e35d742059b76e69106c2bbf604c37a (diff)
downloadxmonad-bd91b7ae4362dc3f07bfc30dd946bfcaa9ea9812.tar.gz
xmonad-bd91b7ae4362dc3f07bfc30dd946bfcaa9ea9812.tar.xz
xmonad-bd91b7ae4362dc3f07bfc30dd946bfcaa9ea9812.zip
move fromList into Properties.hs, -17 loc
darcs-hash:20070429035804-9c5c1-6e23a1c166235085f34bda111b332b2ef7b50e01.gz
Diffstat (limited to 'StackSet.hs')
-rw-r--r--StackSet.hs23
1 files changed, 3 insertions, 20 deletions
diff --git a/StackSet.hs b/StackSet.hs
index f7ab36f..d3d08cb 100644
--- a/StackSet.hs
+++ b/StackSet.hs
@@ -24,13 +24,13 @@ module StackSet (
StackSet(..), -- abstract
screen, peekStack, index, empty, peek, push, delete, member,
- raiseFocus, rotate, promote, shift, view, workspace, fromList,
+ raiseFocus, rotate, promote, shift, view, workspace, insert,
size, visibleWorkspaces, swap {- helper -}
) where
import Data.Maybe
-import qualified Data.List as L (delete,genericLength,elemIndex)
-import qualified Data.Map as M
+import qualified Data.List as L (delete,elemIndex)
+import qualified Data.Map as M
------------------------------------------------------------------------
@@ -79,23 +79,6 @@ size = M.size . stacks
------------------------------------------------------------------------
--- | fromList. Build a new StackSet from a list of list of elements,
--- keeping track of the currently focused workspace, and the total
--- number of workspaces. If there are duplicates in the list, the last
--- occurence wins.
-fromList :: (Integral i, Integral j, Ord a) => (i, Int,[[a]]) -> StackSet i j a
-fromList (_,_,[]) = error "Cannot build a StackSet from an empty list"
-
-fromList (n,m,xs) | n < 0 || n >= L.genericLength xs
- = error $ "Cursor index is out of range: " ++ show (n, length xs)
- | m < 1 || m > L.genericLength xs
- = error $ "Can't have more screens than workspaces: " ++ show (m, length xs)
-
-fromList (o,m,xs) = view o $ foldr (\(i,ys) s ->
- foldr (\a t -> insert a i t) s ys)
- (empty (length xs) m) (zip [0..] xs)
-
-
-- | Push. Insert an element onto the top of the current stack.
-- If the element is already in the current stack, it is moved to the top.
-- If the element is managed on another stack, it is removed from that