Skip to content

Commit a81caa1

Browse files
committed
typed-protocols-examples: relaxed constraint in PingPong client
Functor constraint is enough.
1 parent abecdaf commit a81caa1

File tree

1 file changed

+2
-4
lines changed
  • typed-protocols-examples/src/Network/TypedProtocol/PingPong

1 file changed

+2
-4
lines changed

typed-protocols-examples/src/Network/TypedProtocol/PingPong/Client.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ data PingPongClient m a where
5252
-- 'PingPong' protocol.
5353
--
5454
pingPongClientPeer
55-
:: Monad m
55+
:: Functor m
5656
=> PingPongClient m a
5757
-> Client PingPong NonPipelined Z StIdle m a
5858

@@ -76,9 +76,7 @@ pingPongClientPeer (SendMsgPing next) =
7676
-- one corresponding continuation 'kPong' to handle that response.
7777
-- The pong reply has no content so there's nothing to pass to our
7878
-- continuation, but if there were we would.
79-
Effect $ do
80-
client <- next
81-
pure $ pingPongClientPeer client
79+
Effect $ pingPongClientPeer <$> next
8280

8381

8482
--

0 commit comments

Comments
 (0)