typed-protocols-stateful
Safe HaskellNone
LanguageHaskell2010

Network.TypedProtocol.Stateful.Peer.Server

Description

Bidirectional patterns for Peer ps AsServer. The advantage of these patterns is that they automatically provide the RelativeAgencyEq singleton.

Synopsis

Server type alias and its pattern synonyms

type Server ps (st :: ps) (f :: ps -> Type) (m :: Type -> Type) a = Peer ps 'AsServer st f m a Source #

pattern Effect Source #

Arguments

:: forall ps st f m a. m (Server ps st f m a)

monadic continuation

-> Server ps st f m a 

Server role pattern for Effect.

pattern Yield Source #

Arguments

:: forall ps st f m a st'. () 
=> (StateTokenI st, StateTokenI st', StateAgency st ~ 'ServerAgency) 
=> f st 
-> f st' 
-> Message ps st st'

protocol message

-> Server ps st' f m a

continuation

-> Server ps st f m a 

Server role pattern for Yield

pattern Await Source #

Arguments

:: forall ps st f m a. () 
=> (StateTokenI st, StateAgency st ~ 'ClientAgency) 
=> (forall (st' :: ps). f st -> Message ps st st' -> (Server ps st' f m a, f st'))

continuation

-> Server ps st f m a 

Server role pattern for Await

pattern Done Source #

Arguments

:: forall ps st f m a. () 
=> (StateTokenI st, StateAgency st ~ 'NobodyAgency) 
=> a

protocol return value

-> Server ps st f m a 

Server role pattern for Done