From edd6ba8e761a7009c01f39dd25e9a75ca581503f Mon Sep 17 00:00:00 2001 From: Luka Jacobowitz Date: Thu, 28 Sep 2017 09:22:14 +0200 Subject: [PATCH] Make Future a CommutativeMonad --- core/src/main/scala/cats/instances/future.scala | 4 ++-- js/src/test/scala/cats/tests/FutureTests.scala | 2 +- jvm/src/test/scala/cats/tests/FutureTests.scala | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/scala/cats/instances/future.scala b/core/src/main/scala/cats/instances/future.scala index 2c629568165..f24dfddd834 100644 --- a/core/src/main/scala/cats/instances/future.scala +++ b/core/src/main/scala/cats/instances/future.scala @@ -6,8 +6,8 @@ import scala.concurrent.{ExecutionContext, Future} trait FutureInstances extends FutureInstances1 { - implicit def catsStdInstancesForFuture(implicit ec: ExecutionContext): MonadError[Future, Throwable] with CoflatMap[Future] with Monad[Future] = - new FutureCoflatMap with MonadError[Future, Throwable] with Monad[Future] with StackSafeMonad[Future] { + implicit def catsStdInstancesForFuture(implicit ec: ExecutionContext): MonadError[Future, Throwable] with CoflatMap[Future] with CommutativeMonad[Future] = + new FutureCoflatMap with MonadError[Future, Throwable] with CommutativeMonad[Future] with StackSafeMonad[Future] { def pure[A](x: A): Future[A] = Future.successful(x) def flatMap[A, B](fa: Future[A])(f: A => Future[B]): Future[B] = fa.flatMap(f) diff --git a/js/src/test/scala/cats/tests/FutureTests.scala b/js/src/test/scala/cats/tests/FutureTests.scala index 61f4c1010d1..958b5e07641 100644 --- a/js/src/test/scala/cats/tests/FutureTests.scala +++ b/js/src/test/scala/cats/tests/FutureTests.scala @@ -54,7 +54,7 @@ class FutureTests extends CatsSuite { checkAll("Future[Int]", MonadErrorTests[Future, Throwable].monadError[Int, Int, Int]) checkAll("Future[Int]", ComonadTests[Future].comonad[Int, Int, Int]) - checkAll("Future", MonadTests[Future].monad[Int, Int, Int]) + checkAll("Future", CommutativeMonadTests[Future].commutativeMonad[Int, Int, Int]) { implicit val F = ListWrapper.semigroup[Int] diff --git a/jvm/src/test/scala/cats/tests/FutureTests.scala b/jvm/src/test/scala/cats/tests/FutureTests.scala index bf011071a8d..7bf68ed52c5 100644 --- a/jvm/src/test/scala/cats/tests/FutureTests.scala +++ b/jvm/src/test/scala/cats/tests/FutureTests.scala @@ -39,7 +39,7 @@ class FutureTests extends CatsSuite { Arbitrary(arbitrary[Exception].map(identity)) checkAll("Future with Throwable", MonadErrorTests[Future, Throwable].monadError[Int, Int, Int]) - checkAll("Future", MonadTests[Future].monad[Int, Int, Int]) + checkAll("Future", CommutativeMonadTests[Future].commutativeMonad[Int, Int, Int]) checkAll("Future", CoflatMapTests[Future].coflatMap[Int, Int, Int]) {