Skip to content
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

No need for Sink.create arguments functions to return IO #164

Merged
merged 1 commit into from
Jan 23, 2018

Conversation

mariusmuja
Copy link
Collaborator

@mariusmuja mariusmuja commented Jan 22, 2018

There is no need for Sink.create arguments functions to return IOs. Any side-effects that these functions might perform are suspended in the closures.

@mariusmuja mariusmuja changed the title No need for Sink.create function arguments to return IO No need for Sink.create arguments functions to return IO Jan 22, 2018
Copy link
Member

@fdietze fdietze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't fully understand the reasoning behind the change. Could you please explain a bit more why we need Handler.create() to return IO but not Sink.create? How can this be still referentially transparent?

@mariusmuja
Copy link
Collaborator Author

This PR doesn't do anything with the return of Sink.create (doesn't try to fix #81), it only changes the type of the arguments of Sink.create (next, error and complete). I don't see a reason why these argument functions need to return IO types (even if they return IO types, the returned IOs are evaluated immediately).

@fdietze
Copy link
Member

fdietze commented Jan 23, 2018

That makes sense, thanks for the explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants