Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
The ping/pong protocol and the states in its protocol state machine.
This protocol serves as a simple example of the typed protocols framework to help understand the framework and as a template for writing other protocols.
For a slightly more realistic example, see the request/response protocol Network.TypedProtocol.ResResp.Type.
This declares the protocol itself. It is used both as a type level tag for
the protocol and as the kind of the types of the states in the protocol
state machine. That is PingPong
is a kind, and StIdle
is a type of
that kind.
If the protocol needs any type parameters (e.g. for thing that end up in the messages) then those type parameters go here. See the request/response protocol for an example. It is parametrised over the types of the request and response.