Skip to content

Commit

Permalink
PeerPipelined and kind inference (#275)
Browse files Browse the repository at this point in the history
* Make PeerPipelined type arguments of the same kind as PeerSender

* Also update comment.
  • Loading branch information
coot authored and dcoutts committed Feb 11, 2019
1 parent 27f2c87 commit 3468105
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion typed-protocols/src/Network/TypedProtocol/Pipelined.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 0 additions & 4 deletions typed-protocols/src/Network/TypedProtocol/ReqResp/Client.hs
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,13 @@ 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
Expand Down

0 comments on commit 3468105

Please sign in to comment.