From b15bb7c20b11a9f148c4757caba7167ee66492fc Mon Sep 17 00:00:00 2001 From: jao Date: Tue, 19 May 2020 19:38:59 +0100 Subject: hlinting --- src/Xmobar/Plugins/StdinReader.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Xmobar/Plugins/StdinReader.hs b/src/Xmobar/Plugins/StdinReader.hs index 8c0c0bf..a29c1ad 100644 --- a/src/Xmobar/Plugins/StdinReader.hs +++ b/src/Xmobar/Plugins/StdinReader.hs @@ -25,6 +25,7 @@ import System.IO import Xmobar.Run.Exec import Xmobar.X11.Actions (stripActions) import Xmobar.System.Utils (onSomeException) +import Control.Monad (when) data StdinReader = StdinReader | UnsafeStdinReader deriving (Read, Show) @@ -34,11 +35,9 @@ instance Exec StdinReader where -- The EOF check is necessary for certain systems -- More details here https://github.com/jaor/xmobar/issues/442 eof <- isEOF - if eof - then do - hPrint stderr $ "xmobar: eof at an early stage" - exitImmediately ExitSuccess - else return () + when eof $ + do hPrint stderr "xmobar: eof at an early stage" + exitImmediately ExitSuccess s <- getLine `onSomeException` (\e -> do -- cgit v1.2.3