------------------------------------------------------------------------------
-- | Checks, captures and promotions, or moving out of check
forcingMoves :: Board -> [ PseudoLegalMove ]
forcingMoves b =
  let checkers = attackedFromBB b (occupancy b) (b^.B.opponent) (myKingPos b)
      ms = simpleChecks b
            ++ discoveredChecks b
            ++ pawnSimpleChecks b
            ++ pawnDiscoveredChecks b
            ++ castleChecks b
            ++ pawnCapturesSorted b
            ++ pawnPromotions b
            ++ capturesSorted b
            ++ pawnEnPassants b
  in map PseudoLegalMove $ if checkers /= mempty
                           then defendCheck b checkers
                           else ms
forcingMoves :: Board -> [ PseudoLegalMove ]
forcingMoves b =
  let checkers = attackedFromBB b (occupancy b) (b^.B.opponent) (myKingPos b)
      ms = simpleChecks b
            ++ discoveredChecks b
            ++ pawnSimpleChecks b
            ++ pawnDiscoveredChecks b
            ++ castleChecks b
            ++ pawnCapturesSorted b
            ++ pawnPromotions b
            ++ capturesSorted b
            ++ pawnEnPassants b
  in map PseudoLegalMove $ if checkers /= mempty
                           then defendCheck b checkers
                           else ms
forcingMoves b =
  let checkers = attackedFromBB b (occupancy b) (b^.B.opponent) (myKingPos b)
      ms = simpleChecks b
            ++ discoveredChecks b
            ++ pawnSimpleChecks b
            ++ pawnDiscoveredChecks b
            ++ castleChecks b
            ++ pawnCapturesSorted b
            ++ pawnPromotions b
            ++ capturesSorted b
            ++ pawnEnPassants b
  in map PseudoLegalMove $ if checkers /= mempty
                           then defendCheck b checkers
                           else ms