Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- The ordered sequence of turns made by the players of each logical colour.
Synopsis
- data TurnsByLogicalColour turn
- inferNextLogicalColour :: TurnsByLogicalColour turn -> LogicalColour
- countPlies :: TurnsByLogicalColour turn -> NPlies
- dereference :: LogicalColour -> TurnsByLogicalColour turn -> [turn]
- fromAssocs :: Show turn => [(LogicalColour, [turn])] -> TurnsByLogicalColour turn
- update :: TurnsByLogicalColour turn -> [(LogicalColour, [turn])] -> TurnsByLogicalColour turn
- prepend :: LogicalColour -> turn -> Transformation turn
Types
Type-synonyms
Data-types
data TurnsByLogicalColour turn Source #
The type used to hold a record of each player's turns.
Instances
Functions
inferNextLogicalColour :: TurnsByLogicalColour turn -> LogicalColour Source #
- Derive the logical colour of the next player to move.
- CAVEAT: the result can't be guaranteed if
reflectOnX
has been called.
countPlies :: TurnsByLogicalColour turn -> NPlies Source #
- Count the number of plies.
- N.B.:
getNPlies
is more efficient.
dereference :: LogicalColour -> TurnsByLogicalColour turn -> [turn] Source #
Dereference.
Constructors
fromAssocs :: Show turn => [(LogicalColour, [turn])] -> TurnsByLogicalColour turn Source #
Smart constructor.
Mutators
update :: TurnsByLogicalColour turn -> [(LogicalColour, [turn])] -> TurnsByLogicalColour turn Source #
Update.
prepend :: LogicalColour -> turn -> Transformation turn Source #
Prepend the specified turn.