typed-protocols-examples
Safe HaskellNone
LanguageHaskell2010

Network.TypedProtocol.PingPong.Server

Synopsis

Documentation

data PingPongServer (m :: Type -> Type) a Source #

Constructors

PingPongServer 

Fields

  • recvMsgPing :: m (PingPongServer 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 :: a

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

pingPongServerPeer :: forall (m :: Type -> Type) a. Monad m => PingPongServer m a -> Server PingPong 'NonPipelined 'StIdle m a Source #

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