From 56dce7c4feada1d4ca93a312e48813fb1918b93b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Benencia?= Date: Sun, 25 Aug 2013 00:59:04 -0300 Subject: advancing in the monads transformers implementation --- State.hs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'State.hs') diff --git a/State.hs b/State.hs index cb5e426..f4ac3d8 100644 --- a/State.hs +++ b/State.hs @@ -89,6 +89,12 @@ initialColorStyle = ColorStyle { , statusBarColorID = defaultColorID } +scrColsAsInteger st = toInteger $ screenColumns st +scrRowsAsInteger st = toInteger $ screenRows st +curRowAsInteger st = toInteger $ currentRow st +colPadAsInteger st = toInteger $ columnPadding st + + {- data MState = MState { selectedRowMD :: Integer -- Selected row in MaildirMode @@ -146,11 +152,9 @@ decSelectedRow st | (selectedRow st) > 0 = case (mode st) of MaildirMode -> st { selectedRowMD = (selectedRowMD st) - 1 } IndexMode -> st { selectedRowIn = (selectedRowIn st) - 1 } | otherwise = st - +-} + selectedRow st = case (mode st) of - MaildirMode -> selectedRowMD st - IndexMode -> selectedRowIn st + MaildirMode -> selectedRowMD . maildirState $ st + IndexMode -> selectedRowIn . indexState $ st -scrColsAsInt st = fromIntegral $ scrColumns st -scrRowsAsInt st = fromIntegral $ scrRows st --} \ No newline at end of file -- cgit v1.2.3