From 32966cd71c9b572fe2ce9552462dc353eecb8a6a Mon Sep 17 00:00:00 2001 From: Cody Allen Date: Fri, 15 Jul 2016 07:30:01 -0400 Subject: [PATCH] Remove MonadFilter.filterM Resolves #1054. This simply removes `MonadFilter.filterM` to prevent confusion due to this `filterM` being different than that from Haskell or Scalaz. This version of `filterM` doesn't seem particularly useful to me. The only type that comes to mind for which this might be useful is `Option`, and it's pretty easy to come up with a more straightforward implementation for the `Option` case. A more general solution for `filterM` is provided by #1148, but so far there doesn't seem to be any interest in that proposal, so I don't want it to hold up resolving --- core/src/main/scala/cats/MonadFilter.scala | 3 --- 1 file changed, 3 deletions(-) diff --git a/core/src/main/scala/cats/MonadFilter.scala b/core/src/main/scala/cats/MonadFilter.scala index 66d99c7d31..80129ebc82 100644 --- a/core/src/main/scala/cats/MonadFilter.scala +++ b/core/src/main/scala/cats/MonadFilter.scala @@ -15,7 +15,4 @@ import simulacrum.typeclass def filter[A](fa: F[A])(f: A => Boolean): F[A] = flatMap(fa)(a => if (f(a)) pure(a) else empty[A]) - - def filterM[A](fa: F[A])(f: A => F[Boolean]): F[A] = - flatMap(fa)(a => flatMap(f(a))(b => if (b) pure(a) else empty[A])) }