summaryrefslogtreecommitdiffstats
path: root/StackSet.hs
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-06-04 20:22:28 +0200
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-06-04 20:22:28 +0200
commit87353a16e15506c9ec54cbbe7d5010d09f6778c3 (patch)
tree4f54584fe148d2050970245fed1a11c2b5ae6c5e /StackSet.hs
parentee57a01ad607ca3102e3d1646e971d6f153c96c5 (diff)
downloadmetatile-87353a16e15506c9ec54cbbe7d5010d09f6778c3.tar
metatile-87353a16e15506c9ec54cbbe7d5010d09f6778c3.zip
Simplify focusUp/Down
darcs-hash:20070604182228-a5988-4114dc5f3d0c5533f66cb2c34e2f3fe9566f19e0
Diffstat (limited to 'StackSet.hs')
-rw-r--r--StackSet.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/StackSet.hs b/StackSet.hs
index bb581d2..8f8c4e3 100644
--- a/StackSet.hs
+++ b/StackSet.hs
@@ -272,14 +272,12 @@ index = with [] integrate
--
focusUp, focusDown, swapUp, swapDown :: StackSet i a s -> StackSet i a s
focusUp = modify Empty $ \c -> case c of
- Node _ [] [] -> c
Node t (l:ls) rs -> Node l ls (t:rs)
- Node t [] rs -> Node x (xs ++ [t]) [] where (x:xs) = reverse rs
+ Node t [] rs -> Node x xs [] where (x:xs) = reverse (t:rs)
focusDown = modify Empty $ \c -> case c of
- Node _ [] [] -> c
Node t ls (r:rs) -> Node r (t:ls) rs
- Node t ls [] -> Node x [] (xs ++ [t]) where (x:xs) = reverse ls
+ Node t ls [] -> Node x [] xs where (x:xs) = reverse (t:ls)
swapUp = modify Empty $ \c -> case c of
Node _ [] [] -> c