From 0d1841d87a8af266a660c88b93ba495e86a29c77 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Mon, 11 Feb 2019 19:23:36 +0100 Subject: [PATCH 1/2] Make PeerPipelined type arguments of the same kind as PeerSender --- typed-protocols/src/Network/TypedProtocol/Pipelined.hs | 2 +- typed-protocols/src/Network/TypedProtocol/ReqResp/Client.hs | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/typed-protocols/src/Network/TypedProtocol/Pipelined.hs b/typed-protocols/src/Network/TypedProtocol/Pipelined.hs index 446f9ab7d2c..d3dcd521586 100644 --- a/typed-protocols/src/Network/TypedProtocol/Pipelined.hs +++ b/typed-protocols/src/Network/TypedProtocol/Pipelined.hs @@ -11,7 +11,7 @@ module Network.TypedProtocol.Pipelined where import Network.TypedProtocol.Core -data PeerPipelined ps pk st m a where +data PeerPipelined ps (pk :: PeerKind) (st :: ps) m a where PeerPipelined :: PeerSender ps pk st Z c m a -> PeerPipelined ps pk st m a diff --git a/typed-protocols/src/Network/TypedProtocol/ReqResp/Client.hs b/typed-protocols/src/Network/TypedProtocol/ReqResp/Client.hs index 8e876048ea8..67872760916 100644 --- a/typed-protocols/src/Network/TypedProtocol/ReqResp/Client.hs +++ b/typed-protocols/src/Network/TypedProtocol/ReqResp/Client.hs @@ -82,17 +82,14 @@ data ReqRespSender req resp n c m a where SendMsgDonePipelined :: a -> ReqRespSender req resp Z c m a -{- -- This is the inferred type, but using it results in a weird type error! reqRespClientPeerPipelined :: Monad m => ReqRespClientPipelined req resp m a -> PeerPipelined (ReqResp req resp) AsClient StIdle m a --} reqRespClientPeerPipelined (ReqRespClientPipelined peer) = PeerPipelined (reqRespClientPeerSender peer) - reqRespClientPeerSender :: Monad m => ReqRespSender req resp n c m a From c3288791d92fc6c48a17dbef3e1358408220779f Mon Sep 17 00:00:00 2001 From: Duncan Coutts Date: Mon, 11 Feb 2019 18:50:58 +0000 Subject: [PATCH 2/2] Also update comment. --- typed-protocols/src/Network/TypedProtocol/ReqResp/Client.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/typed-protocols/src/Network/TypedProtocol/ReqResp/Client.hs b/typed-protocols/src/Network/TypedProtocol/ReqResp/Client.hs index 67872760916..0624a7de5ae 100644 --- a/typed-protocols/src/Network/TypedProtocol/ReqResp/Client.hs +++ b/typed-protocols/src/Network/TypedProtocol/ReqResp/Client.hs @@ -82,7 +82,6 @@ data ReqRespSender req resp n c m a where SendMsgDonePipelined :: a -> ReqRespSender req resp Z c m a --- This is the inferred type, but using it results in a weird type error! reqRespClientPeerPipelined :: Monad m => ReqRespClientPipelined req resp m a