Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- class Promotable a where
- getMaybePromotionRank :: a -> Maybe Rank
- type EvaluateRank = Rank -> RankValue
- type ArrayByRank = Array Rank
- type UArrayByRank = UArray Rank
- data Rank
- tag :: String
- flank :: [Rank]
- promotionProspects :: [Rank]
- defaultPromotionRank :: Rank
- plodders :: [Rank]
- fixedAttackRange :: [Rank]
- individuallySufficientMaterial :: [Rank]
- pieces :: [Rank]
- nobility :: [Rank]
- range :: [Rank]
- earthBound :: [Rank]
- expendable :: [Rank]
- nDistinctRanks :: NRanks
- initialAllocationByRankPerSide :: ArrayByRank NPieces
- compareByLVA :: EvaluateRank -> Rank -> Rank -> Ordering
- findUndefinedRanks :: [Rank] -> [Rank]
- listArrayByRank :: IArray a e => [e] -> a Rank e
- arrayByRank :: IArray a e => [(Rank, e)] -> a Rank e
Type-classes
class Promotable a where Source #
An interface which data which can represent Pawn
-promotion, can implement.
getMaybePromotionRank :: a -> Maybe Rank Source #
Instances
Promotable PureCoordinate Source # | |
Defined in BishBosh.Notation.PureCoordinate | |
Promotable ICCFNumeric Source # | |
Defined in BishBosh.Notation.ICCFNumeric | |
Promotable MoveType Source # | |
Defined in BishBosh.Attribute.MoveType | |
Promotable Smith Source # | |
Defined in BishBosh.Notation.Smith |
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
A sum-type which represents the component of a chess-piece other than its colour.
Instances
Bounded Rank Source # | |
Enum Rank Source # | |
Eq Rank Source # | |
Ord Rank Source # | |
Read Rank Source # | |
Show Rank Source # | |
Ix Rank Source # | |
NFData Rank Source # | |
Defined in BishBosh.Attribute.Rank | |
XmlPickler Rank Source # | |
Defined in BishBosh.Attribute.Rank | |
FixedMembership Rank Source # | |
Defined in BishBosh.Attribute.Rank |
Constants
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.
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.
The distinct ranks of the pieces from which the back row is composed, i.e. everything except Pawn
s.
The ordered ranks of the pieces from which the back row is composed, including duplicates.
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.