-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can FLOW and PROTOCOL be merged / renamed? #368
Comments
That looks like a great simplification :-) |
Hmmhmm, the distinction is the big deal of Conduit - separate |
Ok, I was disturbed by the diff: craigfe@da9377d#diff-269aef5e17b2566b4fa76d1e6df55c935e918d11ce30b3b94a9a06bb2775afbfL71-L74 By this update, you give an access to |
Indeed, that diff is fairly important to my proposal 🙂 It seems to me that the end-user should be able to connect if the |
I generally try to avoid putting constructors in the interface because it usually doesn't add anything (this is a complaint about the original type endpoint
val connect : endpoint -> (flow, error) result io Since it doesn't say anything about endpoint, which is only used once, this type isn't useful to anyone. If you have extra knowledge about what The main things this does are:
An easy counter example is a single device, such as the null device (of course, you could always define |
To be clear: my choice to keep |
We need |
@samoht I think that's a different kind of endpoint though. Resolvers use |
Yes and we need both 👍. The process of Conduit is to take a concrete type In others words, the process begins with a concrete type (
About the initial question and proposal, I don't have strong opinion to let the I mean, at this stage and considering your update, we can have a simple |
Conduit
currently defines two related module types:FLOW
andPROTOCOL
: an implementation ofFLOW
provides an API for conduit endpoints, andPROTOCOL
extends this with aconnect
function using some notion ofendpoint
.I find this API a bit confusing, mostly because the nouns "flow" and "protocol" suggest very different things to me – despite their similar types in Conduit – e.g.
I think this confusion comes across in some places in the code too, where the words "flow" and "protocol" are sometimes seemingly used interchangeably. I toyed a bit with merging these two module types – leaving just a
FLOW
that suppliesconnect
– in this branch, and it seems quite easy to do.Are there any use-cases where this is an important distinction? (Perhaps in Cohttp?) If so, are there any other names that might make that distinction clearer?
The text was updated successfully, but these errors were encountered: