diff --git a/core/src/main/scala-2.13+/cats/instances/lazyList.scala b/core/src/main/scala-2.13+/cats/instances/lazyList.scala index 807b928dba..0cfc3f414c 100644 --- a/core/src/main/scala-2.13+/cats/instances/lazyList.scala +++ b/core/src/main/scala-2.13+/cats/instances/lazyList.scala @@ -182,9 +182,9 @@ trait LazyListInstances extends cats.kernel.instances.LazyListInstances { def applicative: Applicative[ZipLazyList] = ZipLazyList.catsDataAlternativeForZipLazyList def sequential: ZipLazyList ~> LazyList = - new (ZipLazyList ~> LazyList) { def apply[A](a: ZipLazyList[A]): LazyList[A] = a.value } + new (ZipLazyList ~> LazyList) { def apply[B](zll: ZipLazyList[B]): LazyList[B] = zll.value } def parallel: LazyList ~> ZipLazyList = - new (LazyList ~> ZipLazyList) { def apply[A](v: LazyList[A]): ZipLazyList[A] = new ZipLazyList(v) } + new (LazyList ~> ZipLazyList) { def apply[B](ll: LazyList[B]): ZipLazyList[B] = new ZipLazyList(ll) } } } diff --git a/free/src/main/scala/cats/free/Free.scala b/free/src/main/scala/cats/free/Free.scala index 069210f6e6..a8c759be0f 100644 --- a/free/src/main/scala/cats/free/Free.scala +++ b/free/src/main/scala/cats/free/Free.scala @@ -29,7 +29,7 @@ sealed abstract class Free[S[_], A] extends Product with Serializable { */ final def mapK[T[_]](f: S ~> T): Free[T, A] = foldMap[Free[T, *]] { // this is safe because Free is stack safe - new FunctionK[S, Free[T, *]] { def apply[A](fa: S[A]): Free[T, A] = Suspend(f(fa)) } + new FunctionK[S, Free[T, *]] { def apply[B](sb: S[B]): Free[T, B] = Suspend(f(sb)) } } /** @@ -181,10 +181,10 @@ sealed abstract class Free[S[_], A] extends Product with Serializable { *}}} */ final def inject[G[_]](implicit ev: InjectK[S, G]): Free[G, A] = - mapK(new (S ~> G) { def apply[A](a: S[A]): G[A] = ev.inj(a) }) + mapK(new (S ~> G) { def apply[B](sb: S[B]): G[B] = ev.inj(sb) }) final def toFreeT[G[_]: Applicative]: FreeT[S, G, A] = - foldMap[FreeT[S, G, *]](new (S ~> FreeT[S, G, *]) { def apply[A](a: S[A]): FreeT[S, G, A] = FreeT.liftF(a) }) + foldMap[FreeT[S, G, *]](new (S ~> FreeT[S, G, *]) { def apply[B](sb: S[B]): FreeT[S, G, B] = FreeT.liftF(sb) }) override def toString: String = "Free(...)" diff --git a/free/src/main/scala/cats/free/FreeApplicative.scala b/free/src/main/scala/cats/free/FreeApplicative.scala index adfee32303..efbfa80977 100644 --- a/free/src/main/scala/cats/free/FreeApplicative.scala +++ b/free/src/main/scala/cats/free/FreeApplicative.scala @@ -141,7 +141,7 @@ sealed abstract class FreeApplicative[F[_], A] extends Product with Serializable */ final def compile[G[_]](f: F ~> G): FA[G, A] = foldMap[FA[G, *]] { - new FunctionK[F, FA[G, *]] { def apply[A](fa: F[A]): FA[G, A] = lift(f(fa)) } + new FunctionK[F, FA[G, *]] { def apply[B](fb: F[B]): FA[G, B] = lift(f(fb)) } } /** @@ -154,13 +154,13 @@ sealed abstract class FreeApplicative[F[_], A] extends Product with Serializable /** Interpret this algebra into a Monoid. */ final def analyze[M: Monoid](f: FunctionK[F, λ[α => M]]): M = foldMap[Const[M, *]]( - new FunctionK[F, Const[M, *]] { def apply[A](x: F[A]): Const[M, A] = Const(f(x)) } + new FunctionK[F, Const[M, *]] { def apply[B](fb: F[B]): Const[M, B] = Const(f(fb)) } ).getConst /** Compile this FreeApplicative algebra into a Free algebra. */ final def monad: Free[F, A] = foldMap[Free[F, *]] { - new FunctionK[F, Free[F, *]] { def apply[A](fa: F[A]): Free[F, A] = Free.liftF(fa) } + new FunctionK[F, Free[F, *]] { def apply[B](fb: F[B]): Free[F, B] = Free.liftF(fb) } } override def toString: String = "FreeApplicative(...)" diff --git a/free/src/main/scala/cats/free/FreeInvariantMonoidal.scala b/free/src/main/scala/cats/free/FreeInvariantMonoidal.scala index 15834af55d..469da479db 100644 --- a/free/src/main/scala/cats/free/FreeInvariantMonoidal.scala +++ b/free/src/main/scala/cats/free/FreeInvariantMonoidal.scala @@ -28,13 +28,13 @@ sealed abstract class FreeInvariantMonoidal[F[_], A] extends Product with Serial /** Interpret this algebra into another InvariantMonoidal */ final def compile[G[_]](f: FunctionK[F, G]): FA[G, A] = foldMap[FA[G, *]] { - new FunctionK[F, FA[G, *]] { def apply[A](fa: F[A]): FA[G, A] = lift(f(fa)) } + new FunctionK[F, FA[G, *]] { def apply[B](fb: F[B]): FA[G, B] = lift(f(fb)) } } /** Interpret this algebra into a Monoid */ final def analyze[M: Monoid](f: FunctionK[F, λ[α => M]]): M = foldMap[Const[M, *]]( - new FunctionK[F, Const[M, *]] { def apply[A](x: F[A]): Const[M, A] = Const(f(x)) } + new FunctionK[F, Const[M, *]] { def apply[B](fb: F[B]): Const[M, B] = Const(f(fb)) } ).getConst }