bishbosh-0.0.0.6: Plays chess.

Safe HaskellNone
LanguageHaskell2010

BishBosh.State.TurnsByLogicalColour

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
The ordered sequence of turns made by the players of each logical colour.
Synopsis

Types

Type-synonyms

Data-types

data TurnsByLogicalColour turn Source #

The type used to hold a record of each player's turns.

Instances
Eq turn => Eq (TurnsByLogicalColour turn) Source # 
Instance details

Defined in BishBosh.State.TurnsByLogicalColour

(Read turn, Show turn) => Read (TurnsByLogicalColour turn) Source # 
Instance details

Defined in BishBosh.State.TurnsByLogicalColour

Show turn => Show (TurnsByLogicalColour turn) Source # 
Instance details

Defined in BishBosh.State.TurnsByLogicalColour

NFData turn => NFData (TurnsByLogicalColour turn) Source # 
Instance details

Defined in BishBosh.State.TurnsByLogicalColour

Methods

rnf :: TurnsByLogicalColour turn -> () #

Default (TurnsByLogicalColour turn) Source # 
Instance details

Defined in BishBosh.State.TurnsByLogicalColour

Methods

def :: TurnsByLogicalColour turn #

Empty (TurnsByLogicalColour turn) Source # 
Instance details

Defined in BishBosh.State.TurnsByLogicalColour

Null (TurnsByLogicalColour turn) Source # 
Instance details

Defined in BishBosh.State.TurnsByLogicalColour

ReflectableOnX turn => ReflectableOnX (TurnsByLogicalColour turn) Source # 
Instance details

Defined in BishBosh.State.TurnsByLogicalColour

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

prepend :: LogicalColour -> turn -> Transformation turn Source #

Prepend the specified turn.