Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
Builds a rose-tree from a PGN Database, each node of which contains a move qualified by a move-type, & possibly also the ultimate result & the game's identifier.
- type Name = String
- type OnymousResult = (Name, Result)
- data QualifiedMoveForest x y
- showsNames :: Maybe Int -> [Name] -> ShowS
- findMinimumPieces :: QualifiedMoveForest x y -> NPieces
- count :: QualifiedMoveForest x y -> (NGames, NMoves)
- fromPGNDatabase :: (Eq x, Eq y) => PGNDatabase x y -> QualifiedMoveForest x y
- toGameTree :: (Enum x, Enum y, Ord x, Ord y, Show x, Show y) => QualifiedMoveForest x y -> GameTree x y
- mergePGNDatabase :: (Eq x, Eq y) => PGNDatabase x y -> QualifiedMoveForest x y -> QualifiedMoveForest x y
Types
Type-synonyms
type OnymousResult = (Name, Result) Source #
The name of a game, & it's result.
Data-types
data QualifiedMoveForest x y Source #
- A representation of a PGN-database, where initial moves shared between games are merged into the trunk of a tree from which they each branch.
- Many games will share standard opening moves, & a tree-structure (cf. a list) uses this to increase both time & space efficiency.
- Since there are many different initial moves, the structure is a flat-topped forest rather than a single apex tree.
(Eq x, Eq y) => Eq (QualifiedMoveForest x y) Source # | |
(Show y, Show x) => Show (QualifiedMoveForest x y) Source # | |
Empty (QualifiedMoveForest x y) Source # | |
Null (QualifiedMoveForest x y) Source # | |
(Enum x, Enum y) => ShowNotation (QualifiedMoveForest x y) Source # | |
Functions
findMinimumPieces :: QualifiedMoveForest x y -> NPieces Source #
Find the minimum number of pieces in any of the recorded games.
Constructors
fromPGNDatabase :: (Eq x, Eq y) => PGNDatabase x y -> QualifiedMoveForest x y Source #
Constructor.
toGameTree :: (Enum x, Enum y, Ord x, Ord y, Show x, Show y) => QualifiedMoveForest x y -> GameTree x y Source #
- Convert the specified qualified-move forest to a game-tree.
- To construct a tree from the specified forest, the default initial game is included at the apex.
Mutators
mergePGNDatabase :: (Eq x, Eq y) => PGNDatabase x y -> QualifiedMoveForest x y -> QualifiedMoveForest x y Source #
Include the specified PGN-database into the forest.