diff --git a/core/src/main/scala-2/cats/syntax/MonadOps.scala b/core/src/main/scala-2/cats/syntax/MonadOps.scala index c64b9bf42b..616e668cf6 100644 --- a/core/src/main/scala-2/cats/syntax/MonadOps.scala +++ b/core/src/main/scala-2/cats/syntax/MonadOps.scala @@ -35,6 +35,6 @@ final class MonadOps[F[_], A](private val fa: F[A]) extends AnyVal { M.flatMapOrKeep[A, A1](fa)(pfa) def ifTrueM[B: Monoid](ifTrue: => F[B])(implicit env: F[A] <:< F[Boolean], M: Monad[F]): F[B] = M.ifTrueM(fa)(ifTrue) - def ifFalseM[B: Monoid](ifFalse: => F[B])(implicit env: F[A] <:< F[Boolean],M: Monad[F]): F[B] = + def ifFalseM[B: Monoid](ifFalse: => F[B])(implicit env: F[A] <:< F[Boolean], M: Monad[F]): F[B] = M.ifFalseM(fa)(ifFalse) } diff --git a/core/src/main/scala/cats/Monad.scala b/core/src/main/scala/cats/Monad.scala index 353c35705c..fe5b6e68b7 100644 --- a/core/src/main/scala/cats/Monad.scala +++ b/core/src/main/scala/cats/Monad.scala @@ -168,7 +168,7 @@ trait Monad[F[_]] extends FlatMap[F] with Applicative[F] { * If the `F[Boolean]` is `true` then return `ifTrue` otherwise return `ifFalse` */ def ifTrueM[B: Monoid](fa: F[Boolean])(ifTrue: => F[B]): F[B] = - ifM(fa)(ifTrue, pure(Monoid[B].empty)) + ifM(fa)(ifTrue, pure(Monoid[B].empty)) /** * If the `F[Boolean]` is `false` then return `ifFalse` otherwise return `Monoid[A].empty` diff --git a/tests/shared/src/test/scala/cats/tests/MonadSuite.scala b/tests/shared/src/test/scala/cats/tests/MonadSuite.scala index 173ea48061..93fcffc437 100644 --- a/tests/shared/src/test/scala/cats/tests/MonadSuite.scala +++ b/tests/shared/src/test/scala/cats/tests/MonadSuite.scala @@ -154,7 +154,7 @@ class MonadSuite extends CatsSuite { assert(actual.value === 2) } - test("ifTrueM"){ + test("ifTrueM") { val actual1: Eval[Int] = Eval.later(true).ifTrueM(Eval.later(1)) assert(actual1.value === 1) @@ -162,7 +162,7 @@ class MonadSuite extends CatsSuite { assert(actual2.value === 0) } - test("ifFalseM"){ + test("ifFalseM") { val actual1: Eval[Int] = Eval.later(true).ifFalseM(Eval.later(1)) assert(actual1.value === 0)