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

Add combinator unfoldLoopEval #1594

Merged
merged 4 commits into from
Sep 9, 2019
Merged

Add combinator unfoldLoopEval #1594

merged 4 commits into from
Sep 9, 2019

Conversation

ChristopherDavenport
Copy link
Member

Just a convenience to allow people to work with streams rather than with Pull when they really just want an easy stream constructor

@mpilquist
Copy link
Member

Add ScalaDoc too? Should we also add unfoldLoop -- non-F one?

@kubukoz
Copy link
Member

kubukoz commented Sep 8, 2019

So this is like unfold but at least one element is produced? (since the Option is only on the "next" value we're iterating on, not on that and the produced element)

@ChristopherDavenport
Copy link
Member Author

Yes. It always produces a value, but may or may not iterate. This replaces the paradigm with unfold where you unnecessarily make that initial value an option, just to iterate each layer, and pass None as the final one. This makes behavior like pagination very easy to represent.

@kubukoz
Copy link
Member

kubukoz commented Sep 8, 2019

Indeed, pagination is what I thought about. I like it :)

@mpilquist mpilquist added this to the 1.1.0 milestone Sep 9, 2019
@mpilquist mpilquist merged commit f18b674 into typelevel:series/1.1 Sep 9, 2019
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