IntersectMBO / IntersectMBO/ouroboros-network

Network.TypedProtocol.Driver.runPeer should not use MonadThrow

Open
#594 1 comment 0 reactions 0 assignees View on GitHub
technical debt typed-protocols
Dominant language
Haskell
Stars
296
Forks
104
Avg merge
2d 10h
Merged PRs (30d)
4

Description

Instead of

```Haskell
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

```Haskell
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.