LambdaHack-0.5.0.0: A game engine library for roguelike dungeon crawlers

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.SampleImplementation.SampleMonadClient

Contents

Description

The main game action monad type implementation. Just as any other component of the library, this implementation can be substituted. This module should not be imported anywhere except in Action to expose the executor to any code using the library.

Synopsis

Documentation

executorCli :: CliImplementation resp req () -> SessionUI -> State -> StateClient -> ChanServer resp req -> IO () Source #

Init the client, then run an action, with a given session, state and history, in the IO monad.

Internal operations

data CliImplementation resp req a Source #

Client state transformation monad.

Instances

MonadClientWriteRequest req (CliImplementation resp req) Source # 

Methods

sendRequest :: req -> CliImplementation resp req () Source #

MonadClientReadResponse resp (CliImplementation resp req) Source # 

Methods

receiveResponse :: CliImplementation resp req resp Source #

Monad (CliImplementation resp req) Source # 

Methods

(>>=) :: CliImplementation resp req a -> (a -> CliImplementation resp req b) -> CliImplementation resp req b #

(>>) :: CliImplementation resp req a -> CliImplementation resp req b -> CliImplementation resp req b #

return :: a -> CliImplementation resp req a #

fail :: String -> CliImplementation resp req a #

Functor (CliImplementation resp req) Source # 

Methods

fmap :: (a -> b) -> CliImplementation resp req a -> CliImplementation resp req b #

(<$) :: a -> CliImplementation resp req b -> CliImplementation resp req a #

Applicative (CliImplementation resp req) Source # 

Methods

pure :: a -> CliImplementation resp req a #

(<*>) :: CliImplementation resp req (a -> b) -> CliImplementation resp req a -> CliImplementation resp req b #

(*>) :: CliImplementation resp req a -> CliImplementation resp req b -> CliImplementation resp req b #

(<*) :: CliImplementation resp req a -> CliImplementation resp req b -> CliImplementation resp req a #

MonadStateRead (CliImplementation resp req) Source # 

Methods

getState :: CliImplementation resp req State Source #

getsState :: (State -> a) -> CliImplementation resp req a Source #

MonadStateWrite (CliImplementation resp req) Source # 

Methods

modifyState :: (State -> State) -> CliImplementation resp req () Source #

putState :: State -> CliImplementation resp req () Source #

MonadAtomic (CliImplementation resp req) Source #

The game-state semantics of atomic commands as computed on the client.

MonadClient (CliImplementation resp req) Source # 
MonadClientUI (CliImplementation resp req) Source # 

Methods

getsSession :: (SessionUI -> a) -> CliImplementation resp req a Source #

liftIO :: IO a -> CliImplementation resp req a Source #