Fix issue with use of "root" uncons
/ uncons1
and clarify docs
#808
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was looking into clarifying the docs on
uncons
anduncons1
to say that they should be used in conjunction withStream.scope
(see #797) and noticed what I'd say is a problem - if you useuncons
but don't have a surroundingscope
call orPull
(which usesscope
), you can have a finalizer not run. This test used to fail:That test is now fixed, by adding a call to
scope
inrunFold
, but the note about usingscope
in conjunction withuncons
still applies if you want prompt finalization.Sorry @jedesah but my docs kind of clobber some of your work in #797. I felt like the docs were trying to cover too many things (like the fact that if you reference an effectful stream twice, its effects are repeated... which is not really specific to
uncons
at all, just a general property of effectful streams).This could be backported to 0.9 series also? Not sure how important that is, this would only show up if you were using
uncons
at the "root" of your stream, which I think would be super rare.