aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Stewart <dons@cse.unsw.edu.au>2007-06-26 05:32:02 +0200
committerDon Stewart <dons@cse.unsw.edu.au>2007-06-26 05:32:02 +0200
commit983c66301f8bf0270ab4462c1272c8e8077c3b61 (patch)
treebee99da07bd750c6e206fdc9290ab571a7e87b7f
parentfb09d71524ab2349bb235ac6fd655bd290b614cd (diff)
downloadxmonad-983c66301f8bf0270ab4462c1272c8e8077c3b61.tar.gz
xmonad-983c66301f8bf0270ab4462c1272c8e8077c3b61.tar.xz
xmonad-983c66301f8bf0270ab4462c1272c8e8077c3b61.zip
clean up 'StackSet.filter' for style
darcs-hash:20070626033202-9c5c1-2c9b63321755af27ab1e00c97e82104ca94bf558.gz
-rw-r--r--StackSet.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/StackSet.hs b/StackSet.hs
index 614e95d..e57e80e 100644
--- a/StackSet.hs
+++ b/StackSet.hs
@@ -303,10 +303,10 @@ differentiate (x:xs) = Just $ Stack x [] xs
-- True. Order is preserved, and focus moves to the next node to the right (if
-- necessary).
filter :: (a -> Bool) -> Stack a -> StackOrNot a
-filter p (Stack f ls rs) = case L.filter p (f:rs) of
- (f':rs') -> Just $ Stack f' (L.filter p ls) rs'
- [] -> do f':rs' <- return $ reverse $ L.filter p ls
- Just $ Stack f' [] rs'
+filter p (Stack f ls rs) = Just $ case L.filter p (f:rs) of
+ (f':rs') -> Stack f' (L.filter p ls) rs'
+ _ -> Stack f' [] rs'
+ where (f':rs') = reverse (L.filter p ls)
-- |
-- /O(s)/. Extract the stack on the current workspace, as a list.