Skip to content

Network.TypedProtocol.Driver.runPeer should not use MonadThrow #594

@avieth

Description

@avieth

Instead of

runPeer
  :: forall ps (st :: ps) pr failure bytes m a .
     (MonadThrow m, Exception failure)
  => Tracer m (TraceSendRecv ps)
  -> Codec ps failure m bytes
  -> Channel m bytes
  -> Peer ps pr st m a
  -> m a

it should be

runPeer
  :: forall ps (st :: ps) pr failure bytes m a .
     Tracer m (TraceSendRecv ps)
  -> Codec ps failure m bytes
  -> Channel m bytes
  -> Peer ps pr st m a
  -> m (Either failure a)

There's no sense in prescribing the use of MonadThrow here. The caller can do that as they see fit. Further, the MonadThrow here is not even standard! It's our own special variant. That makes it even more difficult to use.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions