Skip to content
Discussion options

You must be logged in to vote

Thank you for the ping @johnhungerford!

Yes, the scaladoc is incorrect. handle does allow introducing new effects but it has an important restriction: it's not possible to introduce new suspensions of the same effect that is being handled. Given that it recurses until all suspensions of the effect are handled, it'll just recurse indefinitely in case the handling introduces a suspension of the same effect. handle is enough for the majority of the effects but there are cases where it's necessary to suspend the same effect again.

A good example is stream.filter. It handles the stream and needs to emit elements of the same type again if they pass the filter:

def filter[VV >: V, S2](f: VV => B…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@toonvanacker
Comment options

Answer selected by fwbrasil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants