IntersectMBO / IntersectMBO/ouroboros-network
Clean protocols newtype wrapper usage
- Dominant language
- Haskell
- Stars
- 296
- Forks
- 104
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 4
Description
We should:
* keep the top level wrappers, e.g. `newtype ChainSyncClient ... = ChainSyncClient (m ClientStIdle ...`
* but avoid them in callbacks
This way we can keep the right emphasis of what is the top level API, but avoid indirection in various places, e.g.
```
data ClientStNext header point m a =
ClientStNext {
recvMsgRollForward :: header -> point -> ChainSyncClient header point m a,
recvMsgRollBackward :: point -> point -> ChainSyncClient header point m a
}
```
should be:
```
data ClientStNext header point m a =
ClientStNext {
recvMsgRollForward :: header -> point -> m (ClientStIdle header point m a),
recvMsgRollBackward :: point -> point -> m (ClientStIdle header point m a)
}
```
Contributor guide
Assessment
This issue has not been assessed yet.