Skip to content

Use newer version of io-classes #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ packages: ./typed-protocols
source-repository-package
type: git
location: https://github.com/input-output-hk/io-sim
tag: f97c7206bd5ee8cce18f9971cfcfb02b1c6b7ebf
--sha256: 0552lryk9pjzr89kh5g6krn17dnymhklxm6656pgnh5vncy23p18
tag: b9824e8cab3429f0831e01dfc8f0fdecef1a2325
--sha256: 1p5f456d8gidsdxyhwp36r3jhhpizvvgphiv5mv2pgj2si40nklc
subdir:
io-sim
io-classes
Expand Down
6 changes: 2 additions & 4 deletions typed-protocols-examples/src/Network/TypedProtocol/Channel.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ module Network.TypedProtocol.Channel
, loggingChannel
) where

import Control.Concurrent.Class.MonadSTM
import Control.Monad ((>=>))
import Control.Monad.Class.MonadSTM
import Control.Monad.Class.MonadSay
import Control.Monad.Class.MonadTimer
import qualified Data.ByteString as BS
Expand Down Expand Up @@ -243,9 +243,7 @@ channelEffect beforeSend afterRecv Channel{send, recv} =
-- This is intended for testing, as a crude approximation of network delays.
-- More accurate models along these lines are of course possible.
--
delayChannel :: ( MonadSTM m
, MonadTimer m
)
delayChannel :: MonadTimer m
=> DiffTime
-> Channel m a
-> Channel m a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import Network.TypedProtocol.Driver
import Network.TypedProtocol.Pipelined

import Control.Monad.Class.MonadAsync
import Control.Monad.Class.MonadSTM
import Control.Monad.Class.MonadThrow
import Control.Tracer (Tracer (..), contramap, traceWith)

Expand Down Expand Up @@ -138,7 +137,7 @@ runPeer tracer codec channel peer =
--
runPipelinedPeer
:: forall ps (st :: ps) pr failure bytes m a.
(MonadSTM m, MonadAsync m, MonadThrow m, Exception failure)
(MonadAsync m, MonadThrow m, Exception failure)
=> Tracer m (TraceSendRecv ps)
-> Codec ps failure m bytes
-> Channel m bytes
Expand Down Expand Up @@ -181,7 +180,7 @@ data Role = Client | Server
-- The first argument is expected to create two channels that are connected,
-- for example 'createConnectedChannels'.
--
runConnectedPeers :: (MonadSTM m, MonadAsync m, MonadCatch m,
runConnectedPeers :: (MonadAsync m, MonadCatch m,
Exception failure)
=> m (Channel m bytes, Channel m bytes)
-> Tracer m (Role, TraceSendRecv ps)
Expand All @@ -199,7 +198,7 @@ runConnectedPeers createChannels tracer codec client server =
tracerClient = contramap ((,) Client) tracer
tracerServer = contramap ((,) Server) tracer

runConnectedPeersPipelined :: (MonadSTM m, MonadAsync m, MonadCatch m,
runConnectedPeersPipelined :: (MonadAsync m, MonadCatch m,
Exception failure)
=> m (Channel m bytes, Channel m bytes)
-> Tracer m (PeerRole, TraceSendRecv ps)
Expand Down
1 change: 1 addition & 0 deletions typed-protocols/src/Network/TypedProtocol/Driver.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import Data.Void (Void)
import Network.TypedProtocol.Core
import Network.TypedProtocol.Pipelined

import Control.Concurrent.Class.MonadSTM.TQueue
import Control.Monad.Class.MonadAsync
import Control.Monad.Class.MonadFork
import Control.Monad.Class.MonadSTM
Expand Down