From ecb405a5bc3ffb9a65d232c2a59e29d27d88e4cc Mon Sep 17 00:00:00 2001 From: Abhinav Sarkar Date: Sun, 21 Jun 2015 18:27:07 +0530 Subject: [PATCH] Hlinting. --- hask-irc-core/Network/IRC/Bot.hs | 6 +++--- hask-irc-handlers/Network/IRC/Handlers/MessageLogger.hs | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hask-irc-core/Network/IRC/Bot.hs b/hask-irc-core/Network/IRC/Bot.hs index 67ccc8b..824c1a8 100644 --- a/hask-irc-core/Network/IRC/Bot.hs +++ b/hask-irc-core/Network/IRC/Bot.hs @@ -61,16 +61,16 @@ sendCommandLoop commandChan bot@Bot { .. } = do forM_ exs $ \(ex :: SomeException) -> errorM ("Error while formatting command: " ++ show cmd ++ "\nError: " ++ show ex) - when (not . null $ lines_) $ + unless (null lines_) $ handle (\(e :: SomeException) -> do errorM ("Error while writing to connection: " ++ show e) - closeMessageChannel commandChan) $ do + closeMessageChannel commandChan) $ forM_ lines_ $ \line -> do TF.hprint botSocket "{}\r\n" $ TF.Only line infoM . unpack $ "> " ++ line commandChanClosed <- isClosedMessageChannel commandChan - when (not commandChanClosed) $ + unless commandChanClosed $ case fromMessage cmd of Just QuitCmd -> closeMessageChannel commandChan _ -> sendCommandLoop commandChan bot diff --git a/hask-irc-handlers/Network/IRC/Handlers/MessageLogger.hs b/hask-irc-handlers/Network/IRC/Handlers/MessageLogger.hs index d86cd62..601cd21 100644 --- a/hask-irc-handlers/Network/IRC/Handlers/MessageLogger.hs +++ b/hask-irc-handlers/Network/IRC/Handlers/MessageLogger.hs @@ -7,7 +7,6 @@ import qualified Data.Text.Format as TF import qualified Data.Text.Format.Params as TF import ClassyPrelude hiding ((), (<.>), FilePath, log) -import Control.Exception.Lifted (mask_) import Data.Time (diffDays) import System.Directory (createDirectoryIfMissing, getModificationTime, copyFile, removeFile) import System.FilePath (FilePath, (), (<.>))