Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- The ordered sequence of turns alternately made by the players of each logical colour.
Synopsis
- data TurnsByLogicalColour turn
- inferNextLogicalColour :: TurnsByLogicalColour turn -> LogicalColour
- countPlies :: TurnsByLogicalColour turn -> NPlies
- dereference :: TurnsByLogicalColour turn -> LogicalColour -> [turn]
- fromAssocs :: Show turn => [(LogicalColour, [turn])] -> TurnsByLogicalColour turn
- update :: [(LogicalColour, [turn])] -> Transformation 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 total number of plies, regardless of the player.
- CAVEAT:
getNPlies
is more efficient.
dereference :: TurnsByLogicalColour turn -> LogicalColour -> [turn] Source #
Dereference.
Constructors
fromAssocs :: Show turn => [(LogicalColour, [turn])] -> TurnsByLogicalColour turn Source #
Smart constructor.
Mutators
update :: [(LogicalColour, [turn])] -> Transformation turn Source #
- Update the specified logical colours.
- CAVEAT: obliterates any incumbent data for the specified logical colours.
prepend :: LogicalColour -> turn -> Transformation turn Source #
Prepend the specified turn.