Skip to content

Is there an equivalent to GroupedWithin in language-ext? #1155

Answered by louthy
LaszloLueck asked this question in Q&A
Discussion options

You must be logged in to vote

Streams in language-ext can be achieved with Pipes, which is a part of the Effects system. What you're describing is a fold on a stream. Folds manage an aggregate value until a trigger event that then yields the value downstream.

There's a simple example in the EffectsExamples: FoldTest sample. It listens to the stream of characters from the console and aggregates them into words.

There's similar examples which chunk 80 characters at a time from any stream

Outside of that the new functionality that I'm building into language-ext v5.0 will bring stream-like functionality to all monadic types (along with folding), but that's a ways off yet.

Although this isn't exactly what you're asking for…

Replies: 1 comment 1 reply

Comment options

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

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