Create a piece with the given color and type.
make PieceColor.white PieceType.queen == whiteQueen
make PieceColor.black PieceType.knight == blackKnightGet the color of a piece.
color whiteBishop == PieceColor.white
color blackQueen == PieceColor.blackGet the type of a piece. Unfortunately, the name type is taken, so we
have to use an awkward name.
kind whiteBishop == PieceType.bishop
kind blackQueen == PieceType.queenList of all pieces
A white pawn.
A white knight.
A white bishop.
A white rook.
A white queen.
A white king.
A black pawn.
A black knight.
A black bishop.
A black rook.
A black queen.
A black king.
Tries to convert a character to a piece, using Forsyth-Edwards notation.
Uppercase letters become white pieces, lowercase letters become black pieces.
If the character is not a valid piece letter, returns Nothing.
fromChar 'R' == Just whiteRook
fromChar 'q' == Just blackQueen
fromChar 'x' == NothingTries to convert a string to a piece by inspecting the first character and
using Forsyth-Edwards notation. Uppercase letters become white pieces, lowercase
letters become black pieces. If the character is not a valid piece letter, or
if the string is empty, returns Nothing.
fromString "R" == Just whiteRook
fromString "Kbb" == Just whiteKing
fromString "q" == Just blackQueen
fromString "x" == NothingConverts a piece to its corresponding character in Forsyth-Edwards notation. White pieces become uppercase letters, black pieces become lowercase letters.
toChar whiteRook == 'R'
toChar blackQueen == 'q'Converts a piece to a single-character string containing the pices's corresponding character in Forsyth-Edwards notation. White pieces become uppercase letters, black pieces become lowercase letters.
toString whiteRook == "R"
toString blackQueen == "q"
Type representing a chess piece, with a color (white or black) and a type (pawn, bishop, knight, etc.).