Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- Records the number of times each position has been encountered.
- leastCyclicPlies :: NMoves
- data InstancesByPosition position
- countConsecutiveRepeatablePlies :: InstancesByPosition position -> NMoves
- countPositionRepetitions :: InstancesByPosition position -> NBoards
- getNDistinctPositions :: InstancesByPosition position -> NBoards
- mkInstancesByPosition :: NBoardsByPosition position -> InstancesByPosition position
- mkSingleton :: position -> InstancesByPosition position
- insertPosition :: Ord position => Bool -> position -> Transformation position
- deletePosition :: Ord position => position -> Transformation position
- anyInstancesByPosition :: (NBoards -> Bool) -> InstancesByPosition position -> Bool
Types
Type-synonyms
Constants
leastCyclicPlies :: NMoves Source #
The smallast number of repeatable plies required to form a cycle.
Data-types
data InstancesByPosition position Source #
- A count of the number of instances of positions which have occurred.
- Greater than '1' represents a repetition.
Eq position => Eq (InstancesByPosition position) Source # | |
NFData position => NFData (InstancesByPosition position) Source # | |
(Ord position, ReflectableOnX position) => ReflectableOnX (InstancesByPosition position) Source # | |
Functions
countConsecutiveRepeatablePlies :: InstancesByPosition position -> NMoves Source #
Count the total number of consecutive repeatable plies amongst recent moves.
countPositionRepetitions :: InstancesByPosition position -> NBoards Source #
Count the total number of repetitions of positions.
getNDistinctPositions :: InstancesByPosition position -> NBoards Source #
The number of distinct positions.
Constructors
mkInstancesByPosition :: NBoardsByPosition position -> InstancesByPosition position Source #
Smart constructor.
mkSingleton :: position -> InstancesByPosition position Source #
Constructor.
Mutators
:: Ord position | |
=> Bool | Whether the turn which led to the specified position, was repeatable. |
-> position | |
-> Transformation position |
Insert a position into the collection.
deletePosition :: Ord position => position -> Transformation position Source #
Remove a position from the collection, as required to implement rollback.
Predicates
anyInstancesByPosition :: (NBoards -> Bool) -> InstancesByPosition position -> Bool Source #
Predicate: apply the specified predicate to the map.