------------------------------------------------------------------------------
pawnMoves :: Board -> (Square -> Square -> Bool) -> [ Move ]
pawnMoves b fun = do
  (f, t, enp) <- pawnAdvanceSquares b
                 ++ pawnCaptureSquares b
                 ++ pawnEnPassantSquares b
  guard $ fun f t
  map (enPassantTarget .~ enp) $ promote
    $ (capturedPiece .~ pieceAt b t)
    $ defaultMove f t Pawn (b^.next)


------------------------------------------------------------------------------
pawnMoves :: Board -> (Square -> Square -> Bool) -> [ Move ]
pawnMoves b fun = do
  (f, t, enp) <- pawnAdvanceSquares b
                 ++ pawnCaptureSquares b
                 ++ pawnEnPassantSquares b
  guard $ fun f t
  map (enPassantTarget .~ enp) $ promote
    $ (capturedPiece .~ pieceAt b t)
    $ defaultMove f t Pawn (b^.next)


------------------------------------------------------------------------------
pawnMoves b fun = do
  (f, t, enp) <- pawnAdvanceSquares b
                 ++ pawnCaptureSquares b
                 ++ pawnEnPassantSquares b
  guard $ fun f t
  map (enPassantTarget .~ enp) $ promote
    $ (capturedPiece .~ pieceAt b t)
    $ defaultMove f t Pawn (b^.next)


------------------------------------------------------------------------------