Skip to content

Commit

Permalink
Update ouroboros-network-protocols/testlib/Ouroboros/Network/Protocol…
Browse files Browse the repository at this point in the history
…/KeepAlive/Direct.hs

Co-authored-by: Marcin Szamotulski <[email protected]>
  • Loading branch information
karknu and coot authored Oct 18, 2023
1 parent 1a04523 commit 049bab9
Showing 1 changed file with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@ direct :: forall a b m. Monad m
-> KeepAliveClient m b
-> m (a, b)
direct srv (KeepAliveClient clientM) = do
go srv =<< clientM
go srv =<< clientM
where
go :: Monad m
=> KeepAliveServer m a
-> KeepAliveClientSt m b
-> m (a, b)
go KeepAliveServer { recvMsgDone }
(SendMsgDone mdone) =
(,) <$> recvMsgDone <*> mdone
go KeepAliveServer { recvMsgKeepAlive }
(SendMsgKeepAlive _cookie mclient) = do
server <- recvMsgKeepAlive
client <- mclient
go server client
go :: Monad m
=> KeepAliveServer m a
-> KeepAliveClientSt m b
-> m (a, b)
go KeepAliveServer { recvMsgDone }
(SendMsgDone mdone) =
(,) <$> recvMsgDone <*> mdone
go KeepAliveServer { recvMsgKeepAlive }
(SendMsgKeepAlive _cookie mclient) =
go <$> recvMsgKeepAlive
<*> mclient

0 comments on commit 049bab9

Please sign in to comment.