Safe Haskell | None |
---|---|
Language | Haskell2010 |
The type of the chain synchronisation protocol.
Since we are using a typed protocol framework this is in some sense the definition of the protocol: what is allowed and what is not allowed.
Synopsis
- data ChainSync (header :: k) (point :: k1) (tip :: k2) where
- StIdle :: forall {k} {k1} {k2} (header :: k) (point :: k1) (tip :: k2). ChainSync header point tip
- StNext :: forall {k} {k1} {k2} (header :: k) (point :: k1) (tip :: k2). StNextKind -> ChainSync header point tip
- StIntersect :: forall {k} {k1} {k2} (header :: k) (point :: k1) (tip :: k2). ChainSync header point tip
- StDone :: forall {k} {k1} {k2} (header :: k) (point :: k1) (tip :: k2). ChainSync header point tip
- data SingChainSync (k3 :: ChainSync header point tip) where
- SingIdle :: forall {k} {k1} {k2} {header :: k} {point :: k1} {tip :: k2}. SingChainSync ('StIdle :: ChainSync header point tip)
- SingNext :: forall {k} {k1} {k2} {header :: k} {point :: k1} {tip :: k2} (k4 :: StNextKind). SingNextKind k4 -> SingChainSync ('StNext k4 :: ChainSync header point tip)
- SingIntersect :: forall {k} {k1} {k2} {header :: k} {point :: k1} {tip :: k2}. SingChainSync ('StIntersect :: ChainSync header point tip)
- SingDone :: forall {k} {k1} {k2} {header :: k} {point :: k1} {tip :: k2}. SingChainSync ('StDone :: ChainSync header point tip)
- data StNextKind where
- data SingNextKind (k :: StNextKind) where
- data TokNextKind (k :: StNextKind) where
Documentation
data ChainSync (header :: k) (point :: k1) (tip :: k2) where Source #
A kind to identify our protocol, and the types of the states in the state transition diagram of the protocol.
StIdle :: forall {k} {k1} {k2} (header :: k) (point :: k1) (tip :: k2). ChainSync header point tip | Both client and server are idle. The client can send a request and the server is waiting for a request. |
StNext :: forall {k} {k1} {k2} (header :: k) (point :: k1) (tip :: k2). StNextKind -> ChainSync header point tip | The client has sent a next update request. The client is now waiting for a response, and the server is busy getting ready to send a response. There are two possibilities here, since the server can send a reply immediately or it can send an initial await message followed later by the normal reply. |
StIntersect :: forall {k} {k1} {k2} (header :: k) (point :: k1) (tip :: k2). ChainSync header point tip | The client has sent an intersection request. The client is now waiting for a response, and the server is busy getting ready to send a response. |
StDone :: forall {k} {k1} {k2} (header :: k) (point :: k1) (tip :: k2). ChainSync header point tip | Both the client and server are in the terminal state. They're done. |
Instances
(ShowProxy header, ShowProxy tip) => ShowProxy (ChainSync header point tip :: Type) Source # | |||||
(NFData header, NFData point, NFData tip) => NFData (Message (ChainSync header point tip) from to) Source # | |||||
Defined in Ouroboros.Network.Protocol.ChainSync.Type | |||||
(Show header, Show point, Show tip) => Show (Message (ChainSync header point tip) from to) Source # | |||||
Protocol (ChainSync header point tip) Source # | |||||
Defined in Ouroboros.Network.Protocol.ChainSync.Type
| |||||
StateTokenI ('StDone :: ChainSync header point tip) Source # | |||||
Defined in Ouroboros.Network.Protocol.ChainSync.Type stateToken :: StateToken ('StDone :: ChainSync header point tip) # | |||||
StateTokenI ('StIdle :: ChainSync header point tip) Source # | |||||
Defined in Ouroboros.Network.Protocol.ChainSync.Type stateToken :: StateToken ('StIdle :: ChainSync header point tip) # | |||||
StateTokenI ('StIntersect :: ChainSync header point tip) Source # | |||||
Defined in Ouroboros.Network.Protocol.ChainSync.Type stateToken :: StateToken ('StIntersect :: ChainSync header point tip) # | |||||
SingI k4 => StateTokenI ('StNext k4 :: ChainSync header point tip) Source # | |||||
Defined in Ouroboros.Network.Protocol.ChainSync.Type stateToken :: StateToken ('StNext k4 :: ChainSync header point tip) # | |||||
data Message (ChainSync header point tip) (from :: ChainSync header point tip) (to :: ChainSync header point tip) Source # | |||||
Defined in Ouroboros.Network.Protocol.ChainSync.Type data Message (ChainSync header point tip) (from :: ChainSync header point tip) (to :: ChainSync header point tip) where
| |||||
type StateToken Source # | |||||
Defined in Ouroboros.Network.Protocol.ChainSync.Type | |||||
type StateAgency ('StDone :: ChainSync header point tip) Source # | |||||
Defined in Ouroboros.Network.Protocol.ChainSync.Type | |||||
type StateAgency ('StIdle :: ChainSync header point tip) Source # | |||||
Defined in Ouroboros.Network.Protocol.ChainSync.Type | |||||
type StateAgency ('StIntersect :: ChainSync header point tip) Source # | |||||
Defined in Ouroboros.Network.Protocol.ChainSync.Type | |||||
type StateAgency ('StNext _1 :: ChainSync header point tip) Source # | |||||
Defined in Ouroboros.Network.Protocol.ChainSync.Type |
data SingChainSync (k3 :: ChainSync header point tip) where Source #
Singletons for ChainSync
state types.
SingIdle :: forall {k} {k1} {k2} {header :: k} {point :: k1} {tip :: k2}. SingChainSync ('StIdle :: ChainSync header point tip) | |
SingNext :: forall {k} {k1} {k2} {header :: k} {point :: k1} {tip :: k2} (k4 :: StNextKind). SingNextKind k4 -> SingChainSync ('StNext k4 :: ChainSync header point tip) | |
SingIntersect :: forall {k} {k1} {k2} {header :: k} {point :: k1} {tip :: k2}. SingChainSync ('StIntersect :: ChainSync header point tip) | |
SingDone :: forall {k} {k1} {k2} {header :: k} {point :: k1} {tip :: k2}. SingChainSync ('StDone :: ChainSync header point tip) |
Instances
Show (SingChainSync k4) Source # | |
Defined in Ouroboros.Network.Protocol.ChainSync.Type showsPrec :: Int -> SingChainSync k4 -> ShowS # show :: SingChainSync k4 -> String # showList :: [SingChainSync k4] -> ShowS # |
data StNextKind where Source #
Sub-cases of the StNext
state. This is needed since the server can
either send one reply back, or two.
StCanAwait :: StNextKind | The server can reply or send an await msg. |
StMustReply :: StNextKind | The server must now reply, having already sent an await message. |
Instances
SingI 'StCanAwait Source # | |
Defined in Ouroboros.Network.Protocol.ChainSync.Type sing :: Sing 'StCanAwait # | |
SingI 'StMustReply Source # | |
Defined in Ouroboros.Network.Protocol.ChainSync.Type sing :: Sing 'StMustReply # | |
type Sing Source # | |
Defined in Ouroboros.Network.Protocol.ChainSync.Type |
data SingNextKind (k :: StNextKind) where Source #
Instances
Show (SingNextKind k) Source # | |
Defined in Ouroboros.Network.Protocol.ChainSync.Type showsPrec :: Int -> SingNextKind k -> ShowS # show :: SingNextKind k -> String # showList :: [SingNextKind k] -> ShowS # |
data TokNextKind (k :: StNextKind) where Source #
Instances
NFData (TokNextKind k) Source # | |
Defined in Ouroboros.Network.Protocol.ChainSync.Type rnf :: TokNextKind k -> () # |