TicTacToe-0.0.1: A sub-project (exercise) for a functional programming course

Data.TicTacToe.Player

Contents

Description

A player is either player 1 or player 2 (isomorphic to Bool).

Synopsis

Documentation

Reduction

playerSource

Arguments

:: x

If player 1.

-> x

If player 2.

-> Player

The player to fold.

-> x 

Folds a player.

Construction

player1 :: PlayerSource

Player 1.

player2 :: PlayerSource

Player 2.

Decisions

isPlayer1 :: Player -> BoolSource

Returns whether or not the player is player 1.

isPlayer2 :: Player -> BoolSource

Returns whether or not the player is player 2.

Combinator

alternateSource

Arguments

:: Player

The player to alternate.

-> Player 

Switches a player from player 1 to player 2 or vice versa.

toSymbol :: Player -> CharSource

Returns a character symbol denoting each player.