The SquareFile data type and related functions and definitions.
Tries to convert a Char to a SquareFile. Returns Nothing if the
character is not a lowercase letter in the range a-h.
fromChar 'e' == Just e
List.map fromChar [ 'a', 'x', 'h' ] == [ Just a, Nothing, Just h ]Tries to convert a String to a SquareFile by looking at the first
character of the string. Returns Nothing if the first character is not a
lowercase letter in the range a-h.
fromString "e" == Just e
List.map fromChar [ "a", "x", "h" ] == [ Just a, Nothing, Just h ]Converts a SquareFile to a Char in the range a-h.
toChar c == 'c'
List.map toChar all == [ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h' ]Converts a SquareFile to a single-character String consisting of a
letter in the range a-h.
toString c == "c"
List.map toString all == [ "a", "b", "c", "d", "e", "f", "g", "h" ]List of all files on the board.
The 'a' file, the first file from the left, from white's point of view.
The 'b' file, the second file from the left, from white's point of view.
The 'c' file, the third file from the left, from white's point of view.
The 'd' file, the fourth file from the left, from white's point of view.
The 'e' file, the fifth file from the left, from white's point of view.
The 'f' file, the sixth file from the left, from white's point of view.
The 'g' file, the seventh file from the left, from white's point of view.
The 'h' file, the eighth file from the left, from white's point of view.
The horizontal distance between two files.
distance a h == 7
distance e c == 2Convert a file to an index in the range 0 (for the 'a' file) to 7 (for the 'h' file).
SquareFileis a type representing a file on a chess board, i.e. one of the vertical columns labeled a-h.