-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
IdleCircuit
is currently defined as:
{- | Idle state of a Circuit. Aims to provide no data for both the forward and
backward direction. Transactions are not acknowledged.
-}
class (Protocol p) => IdleCircuit p where
idleFwd :: Proxy p -> Fwd (p :: Type)
idleBwd :: Proxy p -> Bwd (p :: Type)
I.e., it forces instances to define both their Fwd and Bwd to be defined simultaneously. This doesn't make sense for protocols such as CSignal
. I think it should be split up in:
class (Protocol p) => IdleFwd p where
idleFwd :: Proxy p -> Fwd (p :: Type)
class (Protocol p) => IdleBwd p where
idleBwd :: Proxy p -> Bwd (p :: Type)
idleSource :: forall p. (IdleFwd p) => Circuit () p
idleSource = Circuit $ const ((), idleFwd $ Proxy @p)
idleSink :: forall p. (IdleBwd p) => Circuit p ()
idleSink = Circuit $ const (idleBwd $ Proxy @p, ())
Metadata
Metadata
Assignees
Labels
No labels