This module defines the PieceColor type and related functions.
The color of a white piece.
The color of a black piece.
List of all piece colors.
all == [ white, black ]The opposite of a color.
opposite white == black
opposite black == whiteTries to convert a character to a PieceColor, using Forsyth-Edwards
encoding.
fromChar 'w' == Just white
fromChar 'b' == Just black
fromChar ch == Nothing -- for all ch not equal to 'w' or 'b'
Tries to convert a string to a PieceColor, using Forsyth-Edwards
encoding.
fromString "w" == Just white
fromString "b" == Just black
fromString str == Nothing -- for all str not starting with "w" or "b"
Convert a PieceColor to a Char of the form used when representing a
board in Forsyth-Edwards notation.
toChar white == 'w'
toChar black == 'b'Convert a PieceColor to a single-character String containing a
Char of the form used when representing a board in Forsyth-Edwards notation.
toChar white == "w"
toChar black == "b"
Type representing the color of a chess piece, or one of the two players.