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
Adding ZStreamChunk#Collect #1379
Conversation
ZStreamChunk(new ZStream[R, E, Chunk[B]] { | ||
override def fold[R1 <: R, E1 >: E, B1 >: Chunk[B], S]: Fold[R1, E1, B1, S] = | ||
ZManaged.succeedLazy { (s, cont, f) => | ||
self.fold[R1, E1, A, S].flatMap { fold => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would unfortunately destroy the chunk structure. Could you try rewriting it with self.chunks.fold
and running collect(p)
on each chunk?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ZStreamChunk(self.chunks.map(e => e.collect(p))
, @iravid any thoughts about this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that'd be nice and short!
@iravid , Please take a look at it once, and let me know if you have any concern. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Could you just move the method definition to be before dropWhile
so that the alphabetical ordering is retained?
Sure, fixed the same. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @shankarshastri!
Fixes #1352