Skip to content
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

TxSubmission2 protocol #2807

Merged
merged 8 commits into from
Dec 20, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 4 additions & 0 deletions typed-protocols/src/Network/TypedProtocol/Core.hs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE QuantifiedConstraints #-}

Expand Down Expand Up @@ -459,3 +461,5 @@ data Peer ps (pr :: PeerRole) (st :: ps) m a where
-> (forall st'. Message ps st st' -> Peer ps pr st' m a)
-> Peer ps pr st m a


deriving instance Functor m => Functor (Peer ps (pr :: PeerRole) (st :: ps) m)
coot marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 5 additions & 0 deletions typed-protocols/src/Network/TypedProtocol/Pipelined.hs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE ViewPatterns #-}

module Network.TypedProtocol.Pipelined
Expand Down Expand Up @@ -37,6 +39,7 @@ data PeerPipelined ps (pr :: PeerRole) (st :: ps) m a where
PeerPipelined :: PeerSender ps pr st Z c m a
-> PeerPipelined ps pr st m a

deriving instance Functor m => Functor (PeerPipelined ps (pr :: PeerRole) (st :: ps) m)

-- | More general than 'fmap', as it allows to change the protocol.
--
Expand Down Expand Up @@ -132,6 +135,8 @@ data PeerSender ps (pr :: PeerRole) (st :: ps) (n :: Outstanding) c m a where
-> (c -> PeerSender ps pr (st :: ps) n c m a)
-> PeerSender ps pr (st :: ps) (S n) c m a

deriving instance Functor m => Functor (PeerSender ps (pr :: PeerRole) (st :: ps) (n :: Outstanding) c m)

data PeerReceiver ps (pr :: PeerRole) (st :: ps) (stdone :: ps) m c where

ReceiverEffect :: m (PeerReceiver ps pr st stdone m c)
Expand Down