IntersectMBO / IntersectMBO/ouroboros-network
Network.TypedProtocol.Driver.runPeer should not use MonadThrow
- 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
Assessment
This issue has not been assessed yet.