typed-protocols-examples
Safe HaskellNone
LanguageHaskell2010

Network.TypedProtocol.ReqResp.Server

Synopsis

Documentation

data ReqRespServer req resp (m :: Type -> Type) 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 :: forall (m :: Type -> Type) req resp a. Monad m => ReqRespServer req resp m a -> Server (ReqResp req resp) 'NonPipelined ('StIdle :: ReqResp req resp) m a Source #

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