Hlinting.
parent
5f7983e1f8
commit
ecb405a5bc
|
@ -61,16 +61,16 @@ sendCommandLoop commandChan bot@Bot { .. } = do
|
||||||
forM_ exs $ \(ex :: SomeException) ->
|
forM_ exs $ \(ex :: SomeException) ->
|
||||||
errorM ("Error while formatting command: " ++ show cmd ++ "\nError: " ++ show ex)
|
errorM ("Error while formatting command: " ++ show cmd ++ "\nError: " ++ show ex)
|
||||||
|
|
||||||
when (not . null $ lines_) $
|
unless (null lines_) $
|
||||||
handle (\(e :: SomeException) -> do
|
handle (\(e :: SomeException) -> do
|
||||||
errorM ("Error while writing to connection: " ++ show e)
|
errorM ("Error while writing to connection: " ++ show e)
|
||||||
closeMessageChannel commandChan) $ do
|
closeMessageChannel commandChan) $
|
||||||
forM_ lines_ $ \line -> do
|
forM_ lines_ $ \line -> do
|
||||||
TF.hprint botSocket "{}\r\n" $ TF.Only line
|
TF.hprint botSocket "{}\r\n" $ TF.Only line
|
||||||
infoM . unpack $ "> " ++ line
|
infoM . unpack $ "> " ++ line
|
||||||
|
|
||||||
commandChanClosed <- isClosedMessageChannel commandChan
|
commandChanClosed <- isClosedMessageChannel commandChan
|
||||||
when (not commandChanClosed) $
|
unless commandChanClosed $
|
||||||
case fromMessage cmd of
|
case fromMessage cmd of
|
||||||
Just QuitCmd -> closeMessageChannel commandChan
|
Just QuitCmd -> closeMessageChannel commandChan
|
||||||
_ -> sendCommandLoop commandChan bot
|
_ -> sendCommandLoop commandChan bot
|
||||||
|
|
|
@ -7,7 +7,6 @@ import qualified Data.Text.Format as TF
|
||||||
import qualified Data.Text.Format.Params as TF
|
import qualified Data.Text.Format.Params as TF
|
||||||
|
|
||||||
import ClassyPrelude hiding ((</>), (<.>), FilePath, log)
|
import ClassyPrelude hiding ((</>), (<.>), FilePath, log)
|
||||||
import Control.Exception.Lifted (mask_)
|
|
||||||
import Data.Time (diffDays)
|
import Data.Time (diffDays)
|
||||||
import System.Directory (createDirectoryIfMissing, getModificationTime, copyFile, removeFile)
|
import System.Directory (createDirectoryIfMissing, getModificationTime, copyFile, removeFile)
|
||||||
import System.FilePath (FilePath, (</>), (<.>))
|
import System.FilePath (FilePath, (</>), (<.>))
|
||||||
|
|
Loading…
Reference in New Issue