ZIO Test: Evaluate Effects Sequentially In Gen#zipWith #4238
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.
Gen#zipWithdescribes combining two generators in a pairwise fashion. We ran into an issue where doing so was leading to generated values not being deterministic because inZStream#zipAllWithwe pull from the two streams in parallel so we could potentially evaluate the random effect in the second stream before the first stream. It would be nice to be able to describe combining streams point wise while evaluating the effects of pulling from the two streams sequentially versus in parallel.To support this I added a new
zipAllWithExecoperator that takes an execution strategy and implementedzipAllWithin terms of that. Then we can callzipAllWithExecfromGen#zipWithto regain deterministic generated values.