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

implement generator for Stream effect #322

Merged
merged 1 commit into from
Oct 18, 2020

Conversation

mattiamanzati
Copy link
Contributor

As stated in gcanti/fp-ts#261 (comment) , I came up with a way of replaying generators locally in order to support do notation for stream

@mikearnaldi mikearnaldi changed the base branch from stream-bad-gen to master October 18, 2020 13:53
let state = iterator.next()
for(let i = 0; i < replayStack.length; i++){
if(state.done){
return fromEffect(die("Something very wrong has happened. Replaying values resulted in a premature end of the generator execution. Provided generator should be pure and perform effects only by yielding them, so that the generator can safely be re-run without side effects."))
Copy link
Member

Choose a reason for hiding this comment

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

Better to make a dedicated Tagged Exception maybe in the GlobalExceptions module

@mikearnaldi mikearnaldi changed the base branch from master to stream-bad-gen October 18, 2020 14:26
@mikearnaldi mikearnaldi merged commit 6b4b4f5 into Effect-TS:stream-bad-gen Oct 18, 2020
fubhy pushed a commit that referenced this pull request Jan 1, 2024
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.

2 participants