Skip to content

Commit 5ec9a8c

Browse files
committed
typed-protocols: connectPipelined type signature
1 parent 0d9cb77 commit 5ec9a8c

File tree

3 files changed

+9
-11
lines changed
  • typed-protocols-examples/test/Network/TypedProtocol
  • typed-protocols/src/Network/TypedProtocol

3 files changed

+9
-11
lines changed

typed-protocols-examples/test/Network/TypedProtocol/PingPong/Tests.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ connect_pipelined :: PingPongClientPipelined Int Identity [Either Int Int]
211211
-> (Int, [Either Int Int])
212212
connect_pipelined client cs =
213213
case runIdentity
214-
(connectPipelined cs []
214+
(connectPipelined cs
215215
(pingPongClientPeerPipelined client)
216-
(promoteToPipelined $ pingPongServerPeer pingPongServerCount))
216+
(pingPongServerPeer pingPongServerCount))
217217
of (reqResps, n, TerminalStates SingDone SingDone) ->
218218
(n, reqResps)
219219

typed-protocols-examples/test/Network/TypedProtocol/ReqResp/Tests.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ prop_connect f xs =
165165
prop_connectPipelined :: [Bool] -> (Int -> Int -> (Int, Int)) -> [Int] -> Bool
166166
prop_connectPipelined cs f xs =
167167
case runIdentity
168-
(connectPipelined cs []
168+
(connectPipelined cs
169169
(reqRespClientPeerPipelined (reqRespClientMapPipelined xs))
170-
(promoteToPipelined $ reqRespServerPeer
170+
(reqRespServerPeer
171171
(reqRespServerMapAccumL (\a -> pure . f a) 0)))
172172

173173
of (c, s, TerminalStates SingDone SingDone) ->

typed-protocols/src/Network/TypedProtocol/Proofs.hs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -243,16 +243,14 @@ promoteToPipelined (Done refl k) = Done refl k
243243
--
244244
connectPipelined
245245
:: forall ps (pr :: PeerRole)
246-
(st :: ps) c c' m a b.
246+
(st :: ps) c m a b.
247247
(Monad m, SingI pr)
248248
=> [Bool]
249-
-> [Bool]
250-
-> Peer ps pr ('Pipelined Z c) st m a
251-
-> Peer ps (FlipAgency pr) ('Pipelined Z c') st m b
249+
-> Peer ps pr ('Pipelined Z c) st m a
250+
-> Peer ps (FlipAgency pr) NonPipelined st m b
252251
-> m (a, b, TerminalStates ps)
253-
connectPipelined csA csB a b =
254-
connect (forgetPipelined csA a)
255-
(forgetPipelined csB b)
252+
connectPipelined csA a b =
253+
connect (forgetPipelined csA a) b
256254

257255
-- | A reference specification for interleaving of requests and responses
258256
-- with pipelining, where the environment can choose whether a response is

0 commit comments

Comments
 (0)