From 34921b79524ed1e6112b82aea6b2e6f9019d5b66 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Fri, 5 Jun 2020 12:05:07 +0200 Subject: [PATCH] Help out type inference on Dotty --- laws/src/main/scala/cats/laws/ApplicativeErrorLaws.scala | 2 +- laws/src/main/scala/cats/laws/discipline/Eq.scala | 2 +- .../scala/cats/laws/discipline/NonEmptyParallelTests.scala | 4 ++-- laws/src/main/scala/cats/laws/discipline/ParallelTests.scala | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/laws/src/main/scala/cats/laws/ApplicativeErrorLaws.scala b/laws/src/main/scala/cats/laws/ApplicativeErrorLaws.scala index dd061468ee..438acec347 100644 --- a/laws/src/main/scala/cats/laws/ApplicativeErrorLaws.scala +++ b/laws/src/main/scala/cats/laws/ApplicativeErrorLaws.scala @@ -32,7 +32,7 @@ trait ApplicativeErrorLaws[F[_], E] extends ApplicativeLaws[F] { F.handleError(fa)(f) <-> F.recover(fa) { case x => f(x) } def recoverConsistentWithRecoverWith[A](fa: F[A], pf: PartialFunction[E, A]): IsEq[F[A]] = - F.recover(fa)(pf) <-> F.recoverWith(fa)(pf.andThen(F.pure _)) + F.recover(fa)(pf) <-> F.recoverWith(fa)(pf.andThen(F.pure(_))) def attemptConsistentWithAttemptT[A](fa: F[A]): IsEq[EitherT[F, E, A]] = EitherT(F.attempt(fa)) <-> F.attemptT(fa) diff --git a/laws/src/main/scala/cats/laws/discipline/Eq.scala b/laws/src/main/scala/cats/laws/discipline/Eq.scala index 4ae4f4a44d..3193131e1c 100644 --- a/laws/src/main/scala/cats/laws/discipline/Eq.scala +++ b/laws/src/main/scala/cats/laws/discipline/Eq.scala @@ -154,7 +154,7 @@ object eq { * and comparing the application of the two functions. */ implicit def catsLawsEqForFn2[A, B, C](implicit A: Arbitrary[A], B: Arbitrary[B], C: Eq[C]): Eq[(A, B) => C] = - Eq.by((_: (A, B) => C).tupled)(catsLawsEqForFn1) + Eq.by((_: (A, B) => C).tupled)(catsLawsEqForFn1[(A, B), C]) /** * `Eq[AndThen]` instance, built by piggybacking on [[catsLawsEqForFn1]]. diff --git a/laws/src/main/scala/cats/laws/discipline/NonEmptyParallelTests.scala b/laws/src/main/scala/cats/laws/discipline/NonEmptyParallelTests.scala index 05fd98b314..ef92f5e834 100644 --- a/laws/src/main/scala/cats/laws/discipline/NonEmptyParallelTests.scala +++ b/laws/src/main/scala/cats/laws/discipline/NonEmptyParallelTests.scala @@ -35,6 +35,6 @@ object NonEmptyParallelTests { def apply[M[_]](implicit ev: NonEmptyParallel[M]): NonEmptyParallelTests.Aux[M, ev.F] = apply[M, ev.F](ev, implicitly) - def apply[M[_], F[_]](implicit ev: NonEmptyParallel.Aux[M, F], D: DummyImplicit): NonEmptyParallelTests.Aux[M, F] = - new NonEmptyParallelTests[M] { val laws = NonEmptyParallelLaws[M] } + def apply[M[_], F0[_]](implicit ev: NonEmptyParallel.Aux[M, F0], D: DummyImplicit): NonEmptyParallelTests.Aux[M, F0] = + new NonEmptyParallelTests[M] { val laws: NonEmptyParallelLaws.Aux[M, F0] = NonEmptyParallelLaws[M](ev) } } diff --git a/laws/src/main/scala/cats/laws/discipline/ParallelTests.scala b/laws/src/main/scala/cats/laws/discipline/ParallelTests.scala index d8827ce819..93fcb7dfa4 100644 --- a/laws/src/main/scala/cats/laws/discipline/ParallelTests.scala +++ b/laws/src/main/scala/cats/laws/discipline/ParallelTests.scala @@ -31,6 +31,6 @@ object ParallelTests { def apply[M[_]](implicit ev: Parallel[M]): ParallelTests.Aux[M, ev.F] = apply[M, ev.F](ev, implicitly) - def apply[M[_], F[_]](implicit ev: Parallel.Aux[M, F], D: DummyImplicit): ParallelTests.Aux[M, F] = - new ParallelTests[M] { val laws = ParallelLaws[M] } + def apply[M[_], F0[_]](implicit ev: Parallel.Aux[M, F0], D: DummyImplicit): ParallelTests.Aux[M, F0] = + new ParallelTests[M] { val laws: ParallelLaws.Aux[M, F0] = ParallelLaws[M](ev) } }