Skip to content

Commit 254a4f8

Browse files
committed
Use newer version of io-classes
There is a circular dependency between `io-sim` and `typed-protocols`.
1 parent 5ee65af commit 254a4f8

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

cabal.project

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ packages: ./typed-protocols
77
source-repository-package
88
type: git
99
location: https://github.com/input-output-hk/io-sim
10-
tag: f97c7206bd5ee8cce18f9971cfcfb02b1c6b7ebf
11-
--sha256: 0552lryk9pjzr89kh5g6krn17dnymhklxm6656pgnh5vncy23p18
10+
tag: b9824e8cab3429f0831e01dfc8f0fdecef1a2325
11+
--sha256: 1p5f456d8gidsdxyhwp36r3jhhpizvvgphiv5mv2pgj2si40nklc
1212
subdir:
1313
io-sim
1414
io-classes

typed-protocols-examples/src/Network/TypedProtocol/Channel.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ module Network.TypedProtocol.Channel
1818
, loggingChannel
1919
) where
2020

21+
import Control.Concurrent.Class.MonadSTM
2122
import Control.Monad ((>=>))
22-
import Control.Monad.Class.MonadSTM
2323
import Control.Monad.Class.MonadSay
2424
import Control.Monad.Class.MonadTimer
2525
import qualified Data.ByteString as BS
@@ -243,9 +243,7 @@ channelEffect beforeSend afterRecv Channel{send, recv} =
243243
-- This is intended for testing, as a crude approximation of network delays.
244244
-- More accurate models along these lines are of course possible.
245245
--
246-
delayChannel :: ( MonadSTM m
247-
, MonadTimer m
248-
)
246+
delayChannel :: MonadTimer m
249247
=> DiffTime
250248
-> Channel m a
251249
-> Channel m a

typed-protocols-examples/src/Network/TypedProtocol/Driver/Simple.hs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import Network.TypedProtocol.Driver
3838
import Network.TypedProtocol.Pipelined
3939

4040
import Control.Monad.Class.MonadAsync
41-
import Control.Monad.Class.MonadSTM
4241
import Control.Monad.Class.MonadThrow
4342
import Control.Tracer (Tracer (..), contramap, traceWith)
4443

@@ -138,7 +137,7 @@ runPeer tracer codec channel peer =
138137
--
139138
runPipelinedPeer
140139
:: forall ps (st :: ps) pr failure bytes m a.
141-
(MonadSTM m, MonadAsync m, MonadThrow m, Exception failure)
140+
(MonadAsync m, MonadThrow m, Exception failure)
142141
=> Tracer m (TraceSendRecv ps)
143142
-> Codec ps failure m bytes
144143
-> Channel m bytes
@@ -181,7 +180,7 @@ data Role = Client | Server
181180
-- The first argument is expected to create two channels that are connected,
182181
-- for example 'createConnectedChannels'.
183182
--
184-
runConnectedPeers :: (MonadSTM m, MonadAsync m, MonadCatch m,
183+
runConnectedPeers :: (MonadAsync m, MonadCatch m,
185184
Exception failure)
186185
=> m (Channel m bytes, Channel m bytes)
187186
-> Tracer m (Role, TraceSendRecv ps)
@@ -199,7 +198,7 @@ runConnectedPeers createChannels tracer codec client server =
199198
tracerClient = contramap ((,) Client) tracer
200199
tracerServer = contramap ((,) Server) tracer
201200

202-
runConnectedPeersPipelined :: (MonadSTM m, MonadAsync m, MonadCatch m,
201+
runConnectedPeersPipelined :: (MonadAsync m, MonadCatch m,
203202
Exception failure)
204203
=> m (Channel m bytes, Channel m bytes)
205204
-> Tracer m (PeerRole, TraceSendRecv ps)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import Data.Void (Void)
2626
import Network.TypedProtocol.Core
2727
import Network.TypedProtocol.Pipelined
2828

29+
import Control.Concurrent.Class.MonadSTM.TQueue
2930
import Control.Monad.Class.MonadAsync
3031
import Control.Monad.Class.MonadFork
3132
import Control.Monad.Class.MonadSTM

0 commit comments

Comments
 (0)