bishbosh-0.0.0.4: Plays chess.

Safe HaskellSafe
LanguageHaskell2010

BishBosh.Cartesian.Abscissa

Contents

Description

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

Types

type ByAbscissa x = Array x Source #

A boxed array indexed by coordinates, of arbitrary elements.

Constants

xOrigin :: Int Source #

The constant length of the x-axis.

xLength :: Distance Source #

The constant length of the x-axis.

xMin :: Enum x => x Source #

The constant lower bound of the abscissa.

xMax :: Enum x => x Source #

The constant upper bound of the abscissa.

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

The constant list of abscissa.

centre :: Fractional centre => centre Source #

  • The constant centre of the span.
  • CAVEAT: no square actually exists at this fractional value.

Functions

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.