typed-protocols-stateful
Safe HaskellNone
LanguageHaskell2010

Network.TypedProtocol.Stateful.Peer.Client

Description

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

Synopsis

Client type alias and its pattern synonyms

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

pattern Effect Source #

Arguments

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

monadic continuation

-> Client ps st f m a 

Client role pattern for Effect.

pattern Yield Source #

Arguments

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

protocol message

-> Client ps st' f m a

continuation

-> Client ps st f m a 

Client role pattern for Yield

pattern Await Source #

Arguments

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

continuation

-> Client ps st f m a 

Client role pattern for Await

pattern Done Source #

Arguments

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

protocol return value

-> Client ps st f m a 

Client role pattern for Done