bishbosh-0.1.1.0: Plays chess.
Safe HaskellNone
LanguageHaskell2010

BishBosh.Cartesian.Abscissa

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
  • Describes the x-axis by which the board is indexed.
  • AKA the file of a piece.
  • N.B. this coordinate-system is for internal use only, and doesn't attempt to replicate any standard chess-notation.
Synopsis

Types

type ArrayByAbscissa x = Array x Source #

A boxed array indexed by coordinates, of arbitrary elements.

Constants

xOrigin :: Int Source #

The position of the origin on the x-axis.

xLength :: Distance Source #

The constant length of the x-axis.

xMin :: Enum x => x Source #

The constant lower bound of abscissae.

xMax :: Enum x => x Source #

The constant upper bound of abscissae.

xBounds :: Enum x => (x, x) Source #

The constant bounds of abscissae.

xRange :: Enum x => [x] Source #

The constant list of all abscissae.

Functions

toIx :: Enum x => x -> Int Source #

Convert to an array-index.

fromIx :: Enum x => Int -> x Source #

Convert from an array-index.

reflect :: Enum x => x -> x Source #

Reflects about the mid-point of the axis.

translate :: (Enum x, Ord x) => (x -> x) -> x -> x Source #

Translate the specified ordinate.

maybeTranslate :: (Enum x, Ord x) => (x -> x) -> x -> Maybe x Source #

Where legal, translate the specified abscissa.

getAdjacents :: (Enum x, Eq x) => x -> [x] Source #

Get the abscissae immediately left & right.

Constructors

listArrayByAbscissa :: (IArray a e, Ix x, Enum x) => [e] -> a x e Source #

Array-constructor.

Predicates

inBounds :: (Enum x, Ord x) => x -> Bool Source #

Predicate.