Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- https://www.chessprogramming.org/Algebraic_Chess_Notation#Pure_coordinate_notation.
- CAVEAT: https://en.wikipedia.org/wiki/Chess_notation defined a variant of this notation.
- N.B.: used for communication via CECP with xboard.
- N.B.: this minimal notation defines the coordinate-system on which Standard Algebraic is based.
Synopsis
- data PureCoordinate x y
- origin :: (Int, Int)
- regexSyntax :: String
- encode :: (Enum x, Enum y) => Coordinates x y -> (ShowS, ShowS)
- showsCoordinates :: (Enum x, Enum y) => Coordinates x y -> ShowS
- readsCoordinates :: (Enum x, Enum y, Ord x, Ord y) => ReadS (Coordinates x y)
- abscissaParser :: Enum x => TextParser x
- ordinateParser :: Enum y => TextParser y
- coordinatesParser :: (Enum x, Enum y, Ord x, Ord y) => TextParser (Coordinates x y)
- mkPureCoordinate :: Move x y -> Maybe Rank -> PureCoordinate x y
- mkPureCoordinate' :: Promotable promotable => Move x y -> promotable -> PureCoordinate x y
Types
Data-types
data PureCoordinate x y Source #
Defines a move, to enable io in PureCoordinate/-notation.
Instances
(Eq x, Eq y) => Eq (PureCoordinate x y) Source # | |
Defined in BishBosh.Notation.PureCoordinate (==) :: PureCoordinate x y -> PureCoordinate x y -> Bool # (/=) :: PureCoordinate x y -> PureCoordinate x y -> Bool # | |
(Enum x, Enum y, Ord x, Ord y) => Read (PureCoordinate x y) Source # | |
Defined in BishBosh.Notation.PureCoordinate readsPrec :: Int -> ReadS (PureCoordinate x y) # readList :: ReadS [PureCoordinate x y] # readPrec :: ReadPrec (PureCoordinate x y) # readListPrec :: ReadPrec [PureCoordinate x y] # | |
(Enum x, Enum y) => Show (PureCoordinate x y) Source # | |
Defined in BishBosh.Notation.PureCoordinate showsPrec :: Int -> PureCoordinate x y -> ShowS # show :: PureCoordinate x y -> String # showList :: [PureCoordinate x y] -> ShowS # | |
Promotable (PureCoordinate x y) Source # | |
Defined in BishBosh.Notation.PureCoordinate getMaybePromotionRank :: PureCoordinate x y -> Maybe Rank Source # |
Constants
regexSyntax :: String Source #
Defines using a regex, the required syntax.
Functions
encode :: (Enum x, Enum y) => Coordinates x y -> (ShowS, ShowS) Source #
Encodes the ordinate & abscissa.
showsCoordinates :: (Enum x, Enum y) => Coordinates x y -> ShowS Source #
Shows the specified coordinates.
readsCoordinates :: (Enum x, Enum y, Ord x, Ord y) => ReadS (Coordinates x y) Source #
Reads coordinates.
abscissaParser :: Enum x => TextParser x Source #
Parse an x-coordinate.
ordinateParser :: Enum y => TextParser y Source #
Parse a y-coordinate.
coordinatesParser :: (Enum x, Enum y, Ord x, Ord y) => TextParser (Coordinates x y) Source #
Parse a pair of coordinates.
Constructors
:: Move x y | |
-> Maybe Rank | The optional promotion-rank. |
-> PureCoordinate x y |
Smart constructor.
:: Promotable promotable | |
=> Move x y | |
-> promotable | The datum from which to extract the optional promotion-rank. |
-> PureCoordinate x y |
Smart constructor.