Skip to content

Commit 5f76136

Browse files
committed
Fix type variable naming
1 parent a68ce94 commit 5f76136

File tree

1 file changed

+30
-30
lines changed
  • ouroboros-network-protocols/src/Ouroboros/Network/Protocol/ObjectDiffusion

1 file changed

+30
-30
lines changed

ouroboros-network-protocols/src/Ouroboros/Network/Protocol/ObjectDiffusion/Outbound.hs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ import Ouroboros.Network.Protocol.ObjectDiffusion.Type
3838
--
3939
-- The peer in the outbound role submits objects to the peer in the server
4040
-- role.
41-
newtype ObjectDiffusionOutbound txid tx m a = ObjectDiffusionOutbound
42-
{ runObjectDiffusionOutbound :: m (OutboundStIdle txid tx m a)
41+
newtype ObjectDiffusionOutbound objectId object m a = ObjectDiffusionOutbound
42+
{ runObjectDiffusionOutbound :: m (OutboundStIdle objectId object m a)
4343
}
4444

4545
-- | In the 'StIdle' protocol state, the outbound does not have agency. Instead
@@ -50,84 +50,84 @@ newtype ObjectDiffusionOutbound txid tx m a = ObjectDiffusionOutbound
5050
-- * a termination message
5151
--
5252
-- It must be prepared to handle any of these.
53-
data OutboundStIdle txid tx m a = OutboundStIdle
53+
data OutboundStIdle objectId object m a = OutboundStIdle
5454
{ recvMsgRequestObjectIds ::
5555
forall blocking.
5656
SingBlockingStyle blocking ->
5757
NumObjectIdsToAck ->
5858
NumObjectIdsToReq ->
59-
m (OutboundStObjectIds blocking txid tx m a),
59+
m (OutboundStObjectIds blocking objectId object m a),
6060
recvMsgRequestObjects ::
61-
[txid] ->
62-
m (OutboundStObjects txid tx m a)
61+
[objectId] ->
62+
m (OutboundStObjects objectId object m a)
6363
}
6464

65-
data OutboundStObjectIds blocking txid tx m a where
65+
data OutboundStObjectIds blocking objectId object m a where
6666
SendMsgReplyObjectIds ::
67-
BlockingReplyList blocking (txid, SizeInBytes) ->
68-
OutboundStIdle txid tx m a ->
69-
OutboundStObjectIds blocking txid tx m a
67+
BlockingReplyList blocking (objectId, SizeInBytes) ->
68+
OutboundStIdle objectId object m a ->
69+
OutboundStObjectIds blocking objectId object m a
7070
-- | In the blocking case, the outbound can terminate the protocol. This could
7171
-- be used when the outbound knows there will be no more objects to submit.
72-
SendMsgDone :: a -> OutboundStObjectIds StBlocking txid tx m a
72+
SendMsgDone :: a -> OutboundStObjectIds StBlocking objectId object m a
7373

74-
data OutboundStObjects txid tx m a where
74+
data OutboundStObjects objectId object m a where
7575
SendMsgReplyObjects ::
76-
[tx] ->
77-
OutboundStIdle txid tx m a ->
78-
OutboundStObjects txid tx m a
76+
[object] ->
77+
OutboundStIdle objectId object m a ->
78+
OutboundStObjects objectId object m a
7979

8080
outboundRun ::
81-
forall (initAgency :: Agency) txid tx m a.
81+
forall (initAgency :: Agency) objectId object m a.
8282
(Monad m) =>
83-
OutboundStIdle txid tx m a ->
84-
Peer (ObjectDiffusion initAgency txid tx) AsOutbound NonPipelined StIdle m a
83+
OutboundStIdle objectId object m a ->
84+
Peer (ObjectDiffusion initAgency objectId object) AsOutbound NonPipelined StIdle m a
8585
outboundRun OutboundStIdle {recvMsgRequestObjectIds, recvMsgRequestObjects} =
8686
Await ReflInboundAgency $ \msg -> case msg of
8787
MsgRequestObjectIds blocking ackNo reqNo -> Effect $ do
8888
reply <- recvMsgRequestObjectIds blocking ackNo reqNo
8989
case reply of
90-
SendMsgReplyObjectIds txids k ->
90+
SendMsgReplyObjectIds objectIds k ->
9191
-- TODO: investigate why GHC cannot infer `SingI`; it used to in
9292
-- `coot/typed-protocols-rewrite` branch
9393
return $ case blocking of
9494
SingBlocking ->
9595
Yield ReflOutboundAgency
96-
(MsgReplyObjectIds txids)
96+
(MsgReplyObjectIds objectIds)
9797
(outboundRun k)
9898
SingNonBlocking ->
9999
Yield ReflOutboundAgency
100-
(MsgReplyObjectIds txids)
100+
(MsgReplyObjectIds objectIds)
101101
(outboundRun k)
102102
SendMsgDone result ->
103103
return $
104104
Yield ReflOutboundAgency
105105
MsgDone
106106
(Done ReflNobodyAgency result)
107-
MsgRequestObjects txids -> Effect $ do
108-
SendMsgReplyObjects txs k <- recvMsgRequestObjects txids
107+
MsgRequestObjects objectIds -> Effect $ do
108+
SendMsgReplyObjects objects k <- recvMsgRequestObjects objectIds
109109
return $
110110
Yield ReflOutboundAgency
111-
(MsgReplyObjects txs)
111+
(MsgReplyObjects objects)
112112
(outboundRun k)
113113

114114
-- | A non-pipelined 'Peer' representing the 'ObjectDiffusionOutbound'.
115115
objectDiffusionOutboundServerPeer ::
116-
forall txid tx m a.
116+
forall objectId object m a.
117117
(Monad m) =>
118-
ObjectDiffusionOutbound txid tx m a ->
119-
Peer (ObjectDiffusion InboundAgency txid tx) AsOutbound NonPipelined StInit m a
118+
ObjectDiffusionOutbound objectId object m a ->
119+
Peer (ObjectDiffusion InboundAgency objectId object) AsOutbound NonPipelined StInit m a
120120
objectDiffusionOutboundServerPeer (ObjectDiffusionOutbound outboundSt) =
121121
-- We need to assist GHC to infer the existentially quantified `c` as
122122
-- `Collect objectId object`
123123
Await ReflInboundAgency
124124
(\MsgInit -> Effect (outboundRun <$> outboundSt))
125125

126126
objectDiffusionOutboundClientPeer ::
127-
forall txid tx m a.
127+
forall objectId object m a.
128128
(Monad m) =>
129-
ObjectDiffusionOutbound txid tx m a ->
130-
Peer (ObjectDiffusion OutboundAgency txid tx) AsOutbound NonPipelined StInit m a
129+
ObjectDiffusionOutbound objectId object m a ->
130+
Peer (ObjectDiffusion OutboundAgency objectId object) AsOutbound NonPipelined StInit m a
131131
objectDiffusionOutboundClientPeer (ObjectDiffusionOutbound outboundSt) =
132132
Yield ReflOutboundAgency MsgInit $
133133
Effect $ outboundRun <$> outboundSt

0 commit comments

Comments
 (0)