Sitelet https://web.archive.org/web/20201129114827/https://github.com/scalaz/scalaz/issues/1980
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

Implement Map.filterM #1980

Open
sideeffffect opened this issue Sep 11, 2018 · 4 comments
Open

Implement Map.filterM #1980

sideeffffect opened this issue Sep 11, 2018 · 4 comments

Comments

@sideeffffect
Copy link

@sideeffffect sideeffffect commented Sep 11, 2018

I would like to contribute filterM for scalaz.Map aka scalaz.==>>

would such contribution be welcome?

@hrhino
Copy link
Member

@hrhino hrhino commented Sep 11, 2018

Contributions are always welcome :)

I think it could be implemented for more than just Map, though. You should be able to implement it for any Traversable/Applicative... could you do that? I imagine you're thinking of something like

def filterM[M[_]: Monad, K, V](fa: K ==>> V)(f: (K, V) => M[Boolean]): M[K ==>> V]

?

@hrhino hrhino added this to the 7.3.0 milestone Sep 11, 2018
@hrhino hrhino added the scalaz7 label Sep 11, 2018
@sideeffffect
Copy link
Author

@sideeffffect sideeffffect commented Sep 12, 2018 •

kida, yes

filterM[F[_]](p: B => F[Boolean])(implicit F: Applicative[F], o: Order[A]): F[A ==>> B]

to be more precise
(you don't even need a Monad, mere Applicative Functor is enough)

@hrhino
Copy link
Member

@hrhino hrhino commented Sep 19, 2018

@sideeffffect either way, please open a pull request if you have an implementation; that's the easiest way to get a new feature 😉

@sideeffffect
Copy link
Author

@sideeffffect sideeffffect commented Sep 19, 2018

sorry, for complicated corporate reasons, it will take weeks before I will open a PR for this -- I just wanted to test the waters that it's even conceivable that something like that function would be accepted
let's hope it won't take long and nobody will be faster than me with ==>>.filterM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.