Showing 32 of 32 total issues

Unused LANGUAGE pragma
Open

{-# LANGUAGE OverloadedStrings #-}

Found

{-# LANGUAGE OverloadedStrings #-}

Perhaps

Redundant bracket
Open

    , hlUnrecognizedCmdMsg = \(CmdCall { cmdCallName = cmd }) ->

Found

(CmdCall{cmdCallName = cmd})

Perhaps

CmdCall{cmdCallName = cmd}

Unused LANGUAGE pragma
Open

{-# LANGUAGE LambdaCase #-}

Found

{-# LANGUAGE LambdaCase #-}

Perhaps

Redundant do
Open

          Nothing -> do
            sendI18nMsg (flip hlCantUndo Nothing)

Found

do sendI18nMsg (flip hlCantUndo Nothing)

Perhaps

sendI18nMsg (flip hlCantUndo Nothing)

Unused LANGUAGE pragma
Open

{-# LANGUAGE StandaloneDeriving #-}

Found

{-# LANGUAGE StandaloneDeriving #-}

Perhaps

Unused LANGUAGE pragma
Open

{-# LANGUAGE NamedFieldPuns #-}
Severity: Minor
Found in halma-telegram-bot/AwsLambdaMain.hs by hlint

Found

{-# LANGUAGE NamedFieldPuns #-}

Perhaps

Unused LANGUAGE pragma
Open

{-# LANGUAGE LambdaCase #-}

Found

{-# LANGUAGE LambdaCase #-}

Perhaps

Redundant bracket
Open

    , hlUnrecognizedCmdMsg = \(CmdCall { cmdCallName = cmd }) ->

Found

(CmdCall{cmdCallName = cmd})

Perhaps

CmdCall{cmdCallName = cmd}

Use tuple-section
Open

      concatMap (\f -> map ((,) f) $ filter (>= f) (neighbours grid f)) fields
Severity: Minor
Found in halma/src/Game/Halma/Board/Draw.hs by hlint

Found

((,) f)

Perhaps

(f,)

Applying this change:

  • may require {-# LANGUAGE TupleSections #-} adding to the top of the file

Redundant bracket
Open

handleCommand call@(CmdCall { cmdCallName = cmd }) = do

Found

(CmdCall{cmdCallName = cmd})

Perhaps

CmdCall{cmdCallName = cmd}

Use fewer imports
Open

import Control.Monad (void, when)

Found

import Control.Monad ( void, when )
import Control.Monad ( unless )

Perhaps

import Control.Monad ( void, when, unless )

Redundant do
Open

      _ -> do
        sendI18nMsg (flip hlCantUndo (Just CantUndoNoGame))

Found

do sendI18nMsg (flip hlCantUndo (Just CantUndoNoGame))

Perhaps

sendI18nMsg (flip hlCantUndo (Just CantUndoNoGame))

Redundant do
Open

            Right afterMove -> do
              handleAfterMove match game afterMove

Found

do handleAfterMove match game afterMove

Perhaps

handleAfterMove match game afterMove

Eta reduce
Open

playersOnLargeGrid players = Configuration LargeGrid players
Severity: Minor
Found in halma/src/Game/Halma/Configuration.hs by hlint

Found

playersOnLargeGrid players = Configuration LargeGrid players

Perhaps

playersOnLargeGrid = Configuration LargeGrid

Unused LANGUAGE pragma
Open

{-# LANGUAGE OverloadedStrings #-}
Severity: Minor
Found in halma-telegram-bot/ServerMain.hs by hlint

Found

{-# LANGUAGE OverloadedStrings #-}

Perhaps

Redundant do
Open

      _ -> do
        sendI18nMsg hlCantStartNewRoundBecauseNoMatch

Found

do sendI18nMsg hlCantStartNewRoundBecauseNoMatch

Perhaps

sendI18nMsg hlCantStartNewRoundBecauseNoMatch

Unused LANGUAGE pragma
Open

{-# LANGUAGE ViewPatterns #-}
Severity: Minor
Found in halma-telegram-bot/ServerMain.hs by hlint

Found

{-# LANGUAGE ViewPatterns #-}

Perhaps

Redundant do
Open

    Nothing -> do
      sendMsg $ textMsg $
        "Can't identify sender of move command " <> showMoveCmd moveCmd <> "!"

Found

do sendMsg $
     textMsg $
       "Can't identify sender of move command " <>
         showMoveCmd moveCmd <> "!"

Perhaps

sendMsg $
  textMsg $
    "Can't identify sender of move command " <>
      showMoveCmd moveCmd <> "!"

Use guards
Open

    go (Just (currentMax, bestMove)) (option@(rating, move):options) =
      if isWin rating then
        option
      else if newRating <= currentMax then
        go (Just (currentMax, bestMove)) options

Found

go (Just (currentMax, bestMove)) (option@(rating, move) : options)
  = if isWin rating then option else
      if newRating <= currentMax then
        go (Just (currentMax, bestMove)) options else
        if boundReached newRating then (newRating, move) else
          go (Just (newRating, move)) options
  where newRating = fst $ nextLevel option (Just currentMax)

Perhaps

go (Just (currentMax, bestMove)) (option@(rating, move) : options)
  | isWin rating = option
  | newRating <= currentMax =
    go (Just (currentMax, bestMove)) options
  | boundReached newRating = (newRating, move)
  | otherwise = go (Just (newRating, move)) options
  where newRating = fst $ nextLevel option (Just currentMax)

Use section
Open

          sendI18nMsg (flip hlNotYourTurn notYourTurnInfo)

Found

(flip hlNotYourTurn notYourTurnInfo)

Perhaps

(`hlNotYourTurn` notYourTurnInfo)
Severity
Category
Status
Source
Language