Skip to content

Commit

Permalink
Help out type inference on Dotty
Browse files Browse the repository at this point in the history
  • Loading branch information
travisbrown committed Jun 19, 2020
1 parent 509306b commit 34921b7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion laws/src/main/scala/cats/laws/ApplicativeErrorLaws.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion laws/src/main/scala/cats/laws/discipline/Eq.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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]].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
}
4 changes: 2 additions & 2 deletions laws/src/main/scala/cats/laws/discipline/ParallelTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
}

0 comments on commit 34921b7

Please sign in to comment.