From b4d12773dbfc26aedf4ce8ed76938e65238a1f1d Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Fri, 9 Mar 2007 05:17:07 +0100 Subject: simplify StackSet api even further (-15 loc) darcs-hash:20070309041707-9c5c1-3c9ef62c25f49b9025f137f73c8d25438a640ff4.gz --- Main.hs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'Main.hs') diff --git a/Main.hs b/Main.hs index 1f51e9c..4a7a914 100644 --- a/Main.hs +++ b/Main.hs @@ -210,11 +210,9 @@ view :: Int -> W () view o = do ws <- gets workspace let m = W.current ws - when (n /= m) $ - whenJust (W.index n ws) $ \new -> - whenJust (W.index m ws) $ \old -> do - mapM_ hide old - mapM_ reveal new - windows $ W.view n + when (n /= m) $ do + mapM_ hide (W.index m ws) + mapM_ reveal (W.index n ws) + windows $ W.view n where n = o-1 -- cgit v1.2.3