From dced73db0b1ad1b8cf892041f9921347ab6e992e Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 27 Jan 2014 15:22:09 -0500 Subject: [PATCH] Minor cleanups in Main. --- src/Main.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Main.hs b/src/Main.hs index 0a2f7d7..6dfbfb7 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -122,8 +122,8 @@ loop !cfg !h !buffer = do -- If we haven't received anything in fifteen minutes, return back -- to the calling function. This should only happen in the case of -- an error, and our caller should be prepared to handle it. - Nothing -> do - report_warning $ "No data received for 15 minutes." + Nothing -> report_warning "No data received for 15 minutes." + Just line -> do -- If the recv didn't timeout, proceed normally. let new_buffer = line : buffer @@ -225,7 +225,7 @@ log_in cfg h = do connect_and_parse :: Configuration -> String -- ^ Hostname to connect to -> IO () -connect_and_parse cfg host = do +connect_and_parse cfg host = bracket acquire_handle release_handle action where five_seconds :: Int @@ -235,7 +235,7 @@ connect_and_parse cfg host = do report_info $ "Connecting to " ++ host ++ "." connectTo host (PortNumber 4500) - release_handle = \h -> do + release_handle h = do report_info $ "Closing connection to " ++ host ++ "." hClose h -- 2.43.2