IntersectMBO / IntersectMBO/ouroboros-network

Clean protocols newtype wrapper usage

Open
#941 0 comments 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

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

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.