-
Notifications
You must be signed in to change notification settings - Fork 56
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
Move some of Sink/Source member functions to extensions #335
Comments
It allows for different implementations to optimize these methods, specifically by offering the option to implement them differently. If those are moved to extension functions, then we face the same hell as with extensions on collections which cannot be easily optimized for specific collection implementations. Typically, you faced it yourself already: #342, #343
I may be missing something, but why not just have a default implementation in the interface itself? |
That's definitely an option to consider |
Sink/Source interfaces declare several member functions that could be easily implemented as extension functions. For example,
Source::peek
,Source::transferTo
, andSink::transferFrom
.Having such functions implemented as member functions does not provide any obvious benefits but requires us to write similar implementations several times. It would be nice to have a single implementation instead.
The text was updated successfully, but these errors were encountered: