Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- The common basis for standard notations.
- CAVEAT: this module is only concerned with the representation of x & y coordinates, not any additional move-feature like enpassant, promotion or castling.
Synopsis
- type CoordinatePairI = (X, Y)
- data Notation
- encode :: Notation -> Coordinates -> (ShowS, ShowS)
- mkMaybeCoordinates :: Notation -> CoordinatePairC -> Maybe Coordinates
- showsCoordinates :: Notation -> Coordinates -> ShowS
- readsCoordinates :: Notation -> ReadS Coordinates
- mkNotation :: CoordinatePairC -> Notation
- inXRange :: Notation -> Char -> Bool
- inYRange :: Notation -> Char -> Bool
Types
Type-synonyms
type CoordinatePairI = (X, Y) Source #
A numeric representation of some coordinates in the standard notation.
Data-types
Functions
mkMaybeCoordinates :: Notation -> CoordinatePairC -> Maybe Coordinates Source #
- Attempt to construct coordinates from the specified characters.
- A check that the specified characters are in the permissible bounds is performed before conversion incase the numeric type has a narrower range than
Char
.
showsCoordinates :: Notation -> Coordinates -> ShowS Source #
Shows the specified coordinates.
readsCoordinates :: Notation -> ReadS Coordinates Source #
Reads coordinates.
Constructors
mkNotation :: CoordinatePairC -> Notation Source #
Smart constructor.