moveKing :: Board -> [ Move ]
moveKing b = do
  t <- toList $ moveFun b King (myKingPos b) .&. complement (myPieces b)
  return
    $ (capturedPiece .~ pieceAt b t)
    $ defaultMove (myKingPos b) t King (b^.next)


------------------------------------------------------------------------------
-- moves capturing on the given square. This function doesn't set the
-- capturedPiece. This function is used for capturing the checking piece.
moveKing :: Board -> [ Move ]
moveKing b = do
  t <- toList $ moveFun b King (myKingPos b) .&. complement (myPieces b)
  return
    $ (capturedPiece .~ pieceAt b t)
    $ defaultMove (myKingPos b) t King (b^.next)


------------------------------------------------------------------------------
-- moves capturing on the given square. This function doesn't set the
-- capturedPiece. This function is used for capturing the checking piece.
moveKing b = do
  t <- toList $ moveFun b King (myKingPos b) .&. complement (myPieces b)
  return
    $ (capturedPiece .~ pieceAt b t)
    $ defaultMove (myKingPos b) t King (b^.next)


------------------------------------------------------------------------------
-- moves capturing on the given square. This function doesn't set the
-- capturedPiece. This function is used for capturing the checking piece.