This module defines the HFiaR monad and all the actions you can perform in it
- data HFiaRT m a
- play :: Monad m => HFiaRT m a -> m Game
- eval :: Monad m => HFiaRT m a -> m a
- data Game
- data Player
- data Tile
- data HFiaRError
- = GameEnded
- | GameNotEnded
- | InvalidColumn
- | FullColumn
- data HFiaRResult
- dropIn :: Monad m => Int -> HFiaRT m (Either HFiaRError ())
- player :: Monad m => HFiaRT m (Either HFiaRError Player)
- board :: Monad m => HFiaRT m [[Tile]]
- result :: Monad m => HFiaRT m (Either HFiaRError HFiaRResult)
Monad controls
Generic HFiaRT type
Types
data HFiaRError Source
Posible errors in the HFiaR Monad
data HFiaRResult Source
Posible results for the game
Actions
Drop a tile in a column
player :: Monad m => HFiaRT m (Either HFiaRError Player)Source
Player who's supposed to play the next tile
result :: Monad m => HFiaRT m (Either HFiaRError HFiaRResult)Source
If the game ended, returns the result of it