hfiar-0.1.1: Four in a Row in Haskell!!

HFiaR

Contents

Description

This module defines the HFiaR monad and all the actions you can perform in it

Synopsis

Monad controls

data HFiaRT m a Source

Generic HFiaRT type

Instances

type HFiaR = HFiaRT IOSource

Specialized HFiaR IO monadic type

play :: Monad m => HFiaRT m a -> m aSource

Run the monad actions and return the result of them

Types

data Player Source

Posible tile / player colours

Constructors

Red 
Green 

Instances

data HFiaRError Source

Posible errors in the HFiaR Monad

data HFiaRResult Source

Posible results for the game

Constructors

Tie 
WonBy Player 

Actions

dropInSource

Arguments

:: Int

Column number

-> HFiaR (Either HFiaRError ()) 

Drop a tile in a column

currentPlayer :: HFiaR (Either HFiaRError Player)Source

Player who's supposed to play the next tile

board :: HFiaR [[Player]]Source

Current board distribution

result :: HFiaR (Either HFiaRError HFiaRResult)Source

If the game ended, returns the result of it