bishbosh-0.1.2.0: Plays chess.
Safe HaskellNone
LanguageHaskell2010

BishBosh.Attribute.Rank

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
Defines the data-type which represents the rank of a chess-piece.
CAVEAT
This term is also commonly used to refer to a row of the board.
Synopsis

Type-classes

class Promotable a where Source #

An interface which data which can represent Pawn-promotion, can implement.

Types

Type-synonyms

type EvaluateRank = Rank -> RankValue Source #

The type of a function which returns a rank's value.

type ArrayByRank = Array Rank Source #

A boxed array indexed by rank, of arbitrary values.

type UArrayByRank = UArray Rank Source #

An unboxed array indexed by rank, of fixed-size values.

Data-types

data Rank Source #

A sum-type which represents the component of a chess-piece other than its colour.

Constructors

Pawn 
Rook 
Knight 
Bishop 
Queen 
King 

Instances

Instances details
Bounded Rank Source # 
Instance details

Defined in BishBosh.Attribute.Rank

Enum Rank Source # 
Instance details

Defined in BishBosh.Attribute.Rank

Methods

succ :: Rank -> Rank #

pred :: Rank -> Rank #

toEnum :: Int -> Rank #

fromEnum :: Rank -> Int #

enumFrom :: Rank -> [Rank] #

enumFromThen :: Rank -> Rank -> [Rank] #

enumFromTo :: Rank -> Rank -> [Rank] #

enumFromThenTo :: Rank -> Rank -> Rank -> [Rank] #

Eq Rank Source # 
Instance details

Defined in BishBosh.Attribute.Rank

Methods

(==) :: Rank -> Rank -> Bool #

(/=) :: Rank -> Rank -> Bool #

Ord Rank Source # 
Instance details

Defined in BishBosh.Attribute.Rank

Methods

compare :: Rank -> Rank -> Ordering #

(<) :: Rank -> Rank -> Bool #

(<=) :: Rank -> Rank -> Bool #

(>) :: Rank -> Rank -> Bool #

(>=) :: Rank -> Rank -> Bool #

max :: Rank -> Rank -> Rank #

min :: Rank -> Rank -> Rank #

Read Rank Source # 
Instance details

Defined in BishBosh.Attribute.Rank

Show Rank Source # 
Instance details

Defined in BishBosh.Attribute.Rank

Methods

showsPrec :: Int -> Rank -> ShowS #

show :: Rank -> String #

showList :: [Rank] -> ShowS #

Ix Rank Source # 
Instance details

Defined in BishBosh.Attribute.Rank

Methods

range :: (Rank, Rank) -> [Rank] #

index :: (Rank, Rank) -> Rank -> Int #

unsafeIndex :: (Rank, Rank) -> Rank -> Int #

inRange :: (Rank, Rank) -> Rank -> Bool #

rangeSize :: (Rank, Rank) -> Int #

unsafeRangeSize :: (Rank, Rank) -> Int #

NFData Rank Source # 
Instance details

Defined in BishBosh.Attribute.Rank

Methods

rnf :: Rank -> () #

XmlPickler Rank Source # 
Instance details

Defined in BishBosh.Attribute.Rank

Methods

xpickle :: PU Rank #

FixedMembership Rank Source # 
Instance details

Defined in BishBosh.Attribute.Rank

Methods

members :: [Rank] Source #

Constants

tag :: String Source #

Used to qualify XML.

flank :: [Rank] Source #

The distinct ranks of the constant ordered range of those pieces of which each side has exactly two.

promotionProspects :: [Rank] Source #

The constant list of distinct rank to which a Pawn may legally be promoted; though there's no point in promotion to other than Queen or Knight.

defaultPromotionRank :: Rank Source #

The rank to which a Pawn is, in the absence of instruction, promoted.

plodders :: [Rank] Source #

The subset of ranks which can only move in single steps.

fixedAttackRange :: [Rank] Source #

The subset of ranks which attack over a fixed range.

individuallySufficientMaterial :: [Rank] Source #

The subset of ranks which lacking support, are sufficient to force checkmate.

pieces :: [Rank] Source #

The distinct ranks of the pieces from which the back row is composed, i.e. everything except Pawns.

nobility :: [Rank] Source #

The ordered ranks of the pieces from which the back row is composed, including duplicates.

range :: [Rank] Source #

The constant ascending list of all ranks.

earthBound :: [Rank] Source #

Those ranks which can't jump.

expendable :: [Rank] Source #

Those ranks which can be taken.

nDistinctRanks :: NRanks Source #

The constant number of distinct ranks.

initialAllocationByRankPerSide :: ArrayByRank NPieces Source #

The constant number of each rank per side, at the conventional opening position.

Functions

compareByLVA :: EvaluateRank -> Rank -> Rank -> Ordering Source #

  • Given two alternative capture moves, this function compares the rank-value of the aggressors.
  • N.B.: a King is always considered most valuable, regardless of the evaluation-function supplied.

findUndefinedRanks :: [Rank] -> [Rank] Source #

Finds any unspecified ranks.

Constructor

listArrayByRank :: IArray a e => [e] -> a Rank e Source #

Array-constructor from an ordered list of elements.

arrayByRank :: IArray a e => [(Rank, e)] -> a Rank e Source #

Array-constructor from an association-list.