-
Notifications
You must be signed in to change notification settings - Fork 114
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
Move Filter To ForEach #1211
Move Filter To ForEach #1211
Conversation
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.
We seem to have lost withFilter
. Otherwise the code looks fine. But what was the motivation, if you don't mind me asking?
It allows the effect type to be different than the collection type. |
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.
Cool
@@ -488,6 +570,8 @@ trait ForEachSyntax { | |||
F.sum(self) | |||
def toChunk(implicit F: ForEach[F]): Chunk[A] = | |||
F.toChunk(self) | |||
def withFilter(f: A => Boolean)(implicit F: ForEach[F], I: IdentityEither[F], B: IdentityBoth[F]): F[A] = |
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.
Maybe we can add the comment
// Provides support for filtering `F[A]` values in for comphrensions.
No description provided.