typed-protocols-examples
Safe HaskellNone
LanguageHaskell2010

Network.TypedProtocol.PingPong.Type

Synopsis

Documentation

data PingPong where Source #

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.

Constructors

StIdle :: PingPong 
StBusy :: PingPong 
StDone :: PingPong 

Instances

Instances details
Protocol PingPong Source # 
Instance details

Defined in Network.TypedProtocol.PingPong.Type

StateTokenI 'StBusy Source # 
Instance details

Defined in Network.TypedProtocol.PingPong.Type

StateTokenI 'StDone Source # 
Instance details

Defined in Network.TypedProtocol.PingPong.Type

StateTokenI 'StIdle Source # 
Instance details

Defined in Network.TypedProtocol.PingPong.Type

Show (Message PingPong from to) Source # 
Instance details

Defined in Network.TypedProtocol.PingPong.Type

Methods

showsPrec :: Int -> Message PingPong from to -> ShowS #

show :: Message PingPong from to -> String #

showList :: [Message PingPong from to] -> ShowS #

data Message PingPong (from :: PingPong) (to :: PingPong) Source # 
Instance details

Defined in Network.TypedProtocol.PingPong.Type

type StateToken Source # 
Instance details

Defined in Network.TypedProtocol.PingPong.Type

type StateAgency 'StBusy Source # 
Instance details

Defined in Network.TypedProtocol.PingPong.Type

type StateAgency 'StDone Source # 
Instance details

Defined in Network.TypedProtocol.PingPong.Type

type StateAgency 'StIdle Source # 
Instance details

Defined in Network.TypedProtocol.PingPong.Type

data SPingPong (st :: PingPong) where Source #

Instances

Instances details
Show (SPingPong st) Source # 
Instance details

Defined in Network.TypedProtocol.PingPong.Type

Methods

showsPrec :: Int -> SPingPong st -> ShowS #

show :: SPingPong st -> String #

showList :: [SPingPong st] -> ShowS #