bishbosh-0.1.3.0: Plays chess.
Safe HaskellNone
LanguageHaskell2010

BishBosh.Notation.Notation

Description

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

Types

Type-synonyms

type CoordinatePairI = (X, Y) Source #

A numeric representation of some coordinates in the standard notation.

Data-types

data Notation Source #

The parameters defining a generic chess-notation.

Functions

encode :: Notation -> Coordinates -> (ShowS, ShowS) Source #

Encodes the ordinate & abscissa.

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.

Constructors

mkNotation :: CoordinatePairC -> Notation Source #

Smart constructor.

Predicates

inXRange :: Notation -> Char -> Bool Source #

Whether the specified character falls within a standard notation's range.

inYRange :: Notation -> Char -> Bool Source #

Whether the specified character falls within a standard notation's range.