typed-protocols-examples-0.2.0.3: Examples and tests for the typed-protocols framework
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.TypedProtocol.ReqResp.Server

Synopsis

Documentation

data ReqRespServer req resp m a Source #

Constructors

ReqRespServer 

Fields

  • recvMsgReq :: req -> m (resp, ReqRespServer req resp m a)

    The client sent us a ping message. We have no choices here, and the response is nullary, all we have are local effects.

  • recvMsgDone :: m a

    The client terminated. Here we have a pure return value, but we could have done another action in m if we wanted to.

reqRespServerPeer :: Monad m => ReqRespServer req resp m a -> Peer (ReqResp req resp) AsServer StIdle m a Source #

Interpret a particular server action sequence into the server side of the ReqResp protocol.