From 3e861fe72dbdbd819aed7c67dddb4e820dee0f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Benencia?= Date: Sun, 25 Aug 2013 18:11:50 -0300 Subject: refactored screenLoop --- Screen.hs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Screen.hs b/Screen.hs index df426fd..b253452 100644 --- a/Screen.hs +++ b/Screen.hs @@ -60,16 +60,14 @@ startCurses = do screenLoop :: LazymailCurses () screenLoop = do w <- liftCurses $ defaultWindow - st <- get cfg <- ask - (_, st') <- liftCurses $ updateWindow w $ runStateT (runReaderT performUpdate cfg) st - put st' + get >>= \st -> + (liftCurses . (updateWindow w) $ runStateT (runReaderT performUpdate cfg) st) >>= put . snd liftCurses $ render handleEvent - st <- get - if (not . exitRequested) st - then screenLoop - else return () + get >>= \st -> if (not . exitRequested) st + then screenLoop + else return () --performUpdate :: LazymailUpdate () performUpdate = do @@ -121,7 +119,6 @@ clearMain rows columns = do then drawEmptyLine $ currentRow + 1 else return () - -- | Helper function of drawMode drawIndexHelper [] = resetCurrentRow drawIndexHelper ((fp, _, msg):ts) = do -- cgit v1.2.3