From ca2ac1364ec6d2ec621be66647c925ee294a6013 Mon Sep 17 00:00:00 2001 From: David Roundy Date: Tue, 12 Jun 2007 15:28:53 +0200 Subject: add differentiate function to StackSet to go [a] -> Stack a. darcs-hash:20070612132853-72aca-01d24069e1f7b66d2dbc9c47e24e4334a45c4346 --- StackSet.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'StackSet.hs') diff --git a/StackSet.hs b/StackSet.hs index 99684ad..581eb0b 100644 --- a/StackSet.hs +++ b/StackSet.hs @@ -75,7 +75,7 @@ module StackSet ( StackSet(..), Workspace(..), Screen(..), Stack(..), RationalRect(..), - new, view, lookupWorkspace, peek, index, integrate, focusUp, focusDown, + new, view, lookupWorkspace, peek, index, integrate, differentiate, focusUp, focusDown, focusWindow, member, findIndex, insertUp, delete, shift, filter, swapMaster, swapUp, swapDown, modify, float, sink -- needed by users ) where @@ -262,6 +262,13 @@ integrate :: Stack a -> [a] integrate Empty = [] integrate (Node x l r) = reverse l ++ x : r +-- | +-- /O(n)/. Texture a list. +-- +differentiate :: [a] -> Stack a +differentiate [] = Empty +differentiate (x:xs) = Node x [] xs + -- | -- /O(n)/. 'filter p s' returns the elements of 's' such that 'p' evaluates to -- True. Order is preserved, and focus moves to the next node to the right (if -- cgit v1.2.3