Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
The type of the trace forwarding/accepting protocol.
Synopsis
- data TraceObjectForward lo where
- StIdle :: TraceObjectForward lo
- StBusy :: StBlockingStyle -> TraceObjectForward lo
- StDone :: TraceObjectForward lo
- data TokBlockingStyle (k :: StBlockingStyle) where
- TokBlocking :: TokBlockingStyle 'StBlocking
- TokNonBlocking :: TokBlockingStyle 'StNonBlocking
- data family Message ps (st :: ps) (st' :: ps)
- data family ClientHasAgency (st :: ps)
- data family ServerHasAgency (st :: ps)
- data family NobodyHasAgency (st :: ps)
- newtype NumberOfTraceObjects = NumberOfTraceObjects {}
- data BlockingReplyList (blocking :: StBlockingStyle) lo where
- BlockingReply :: NonEmpty lo -> BlockingReplyList 'StBlocking lo
- NonBlockingReply :: [lo] -> BlockingReplyList 'StNonBlocking lo
Documentation
data TraceObjectForward lo where Source #
StIdle :: TraceObjectForward lo | Both acceptor and forwarder are in idle state. The acceptor can send a
request for a list of Node's info is an important information about the node, such as its protocol, version, start time, etc. It is assuming that the node must provide this information. |
StBusy :: StBlockingStyle -> TraceObjectForward lo | The acceptor has sent a next request for There are two sub-states for this, for blocking and non-blocking cases. |
StDone :: TraceObjectForward lo | Both the acceptor and forwarder are in the terminal state. They're done. |
Instances
data TokBlockingStyle (k :: StBlockingStyle) where Source #
The value level equivalent of StBlockingStyle
.
This is also used in MsgTraceObjectsRequest
where it is interpreted (and can be encoded)
as a Bool
with True
for blocking, and False
for non-blocking.
TokBlocking :: TokBlockingStyle 'StBlocking | |
TokNonBlocking :: TokBlockingStyle 'StNonBlocking |
Instances
Show (TokBlockingStyle b) Source # | |
Defined in Trace.Forward.Protocol.TraceObject.Type | |
Eq (TokBlockingStyle b) Source # | |
Defined in Trace.Forward.Protocol.TraceObject.Type (==) :: TokBlockingStyle b -> TokBlockingStyle b -> Bool Source # (/=) :: TokBlockingStyle b -> TokBlockingStyle b -> Bool Source # |
data family Message ps (st :: ps) (st' :: ps) Source #
The messages for this protocol. It is expected to be a GADT that is
indexed by the from
and to
protocol states. That is the protocol state
the message transitions from, and the protocol state it transitions into.
These are the edges of the protocol state transition system.
Instances
data family ClientHasAgency (st :: ps) Source #
Tokens for those protocol states in which the client has agency.
Instances
Show (ClientHasAgency st) Source # | |
Defined in Trace.Forward.Protocol.DataPoint.Type | |
Show (ClientHasAgency st) Source # | |
Defined in Trace.Forward.Protocol.TraceObject.Type | |
data ClientHasAgency (st :: DataPointForward) Source # | |
Defined in Trace.Forward.Protocol.DataPoint.Type | |
data ClientHasAgency (st :: TraceObjectForward lo) Source # | |
Defined in Trace.Forward.Protocol.TraceObject.Type data ClientHasAgency (st :: TraceObjectForward lo) where
|
data family ServerHasAgency (st :: ps) Source #
Tokens for those protocol states in which the server has agency.
Instances
Show (ServerHasAgency st) Source # | |
Defined in Trace.Forward.Protocol.DataPoint.Type | |
Show (ServerHasAgency st) Source # | |
Defined in Trace.Forward.Protocol.TraceObject.Type | |
data ServerHasAgency (st :: DataPointForward) Source # | |
Defined in Trace.Forward.Protocol.DataPoint.Type | |
data ServerHasAgency (st :: TraceObjectForward lo) Source # | |
Defined in Trace.Forward.Protocol.TraceObject.Type data ServerHasAgency (st :: TraceObjectForward lo) where
|
data family NobodyHasAgency (st :: ps) Source #
Tokens for terminal protocol states in which neither the client nor server has agency.
Instances
data NobodyHasAgency (st :: DataPointForward) Source # | |
Defined in Trace.Forward.Protocol.DataPoint.Type | |
data NobodyHasAgency (st :: TraceObjectForward lo) Source # | |
Defined in Trace.Forward.Protocol.TraceObject.Type data NobodyHasAgency (st :: TraceObjectForward lo) where
|
newtype NumberOfTraceObjects Source #
A kind to identify our protocol, and the types of the states in the state transition diagram of the protocol.
IMPORTANT NOTE: the following terminology is used:
- From the protocol's point of view, two peers talk to each other: the forwarder and the acceptor.
- The forwarder is an application that collects
TraceObject
s and sends them to the acceptor by request (withMsgTraceObjectsReply
). - The acceptor is an application that receives
TraceObject
s from the forwarder. - You can think of the acceptor as a client, and the forwarder as a server.
After the connection is established, the acceptor asks for
TraceObject
s, the forwarder replies to it.
The acceptor will send this request to the forwarder.
Instances
Generic NumberOfTraceObjects Source # | |
Defined in Trace.Forward.Protocol.TraceObject.Type | |
Show NumberOfTraceObjects Source # | |
Defined in Trace.Forward.Protocol.TraceObject.Type | |
Eq NumberOfTraceObjects Source # | |
Defined in Trace.Forward.Protocol.TraceObject.Type (==) :: NumberOfTraceObjects -> NumberOfTraceObjects -> Bool Source # (/=) :: NumberOfTraceObjects -> NumberOfTraceObjects -> Bool Source # | |
Serialise NumberOfTraceObjects Source # | |
Defined in Trace.Forward.Protocol.TraceObject.Type | |
ShowProxy NumberOfTraceObjects Source # | |
Defined in Trace.Forward.Protocol.TraceObject.Type | |
type Rep NumberOfTraceObjects Source # | |
Defined in Trace.Forward.Protocol.TraceObject.Type type Rep NumberOfTraceObjects = D1 ('MetaData "NumberOfTraceObjects" "Trace.Forward.Protocol.TraceObject.Type" "trace-forward-2.2.2-inplace" 'True) (C1 ('MetaCons "NumberOfTraceObjects" 'PrefixI 'True) (S1 ('MetaSel ('Just "nTraceObjects") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word16))) |
data BlockingReplyList (blocking :: StBlockingStyle) lo where Source #
We have requests for lists of things. In the blocking case the corresponding reply must be non-empty, whereas in the non-blocking case an empty reply is fine.
BlockingReply :: NonEmpty lo -> BlockingReplyList 'StBlocking lo | |
NonBlockingReply :: [lo] -> BlockingReplyList 'StNonBlocking lo |
Instances
Show lo => Show (BlockingReplyList blocking lo) Source # | |
Defined in Trace.Forward.Protocol.TraceObject.Type | |
Eq lo => Eq (BlockingReplyList blocking lo) Source # | |
Defined in Trace.Forward.Protocol.TraceObject.Type (==) :: BlockingReplyList blocking lo -> BlockingReplyList blocking lo -> Bool Source # (/=) :: BlockingReplyList blocking lo -> BlockingReplyList blocking lo -> Bool Source # |