Hlinting.

This commit is contained in:
Abhinav Sarkar 2015-06-21 18:27:07 +05:30
parent 5f7983e1f8
commit ecb405a5bc
2 changed files with 3 additions and 4 deletions

View File

@ -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

View File

@ -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, (</>), (<.>))