Skip to content

Commit ef1c482

Browse files
committed
Run kind-projector Scalafix rules and format
1 parent f304311 commit ef1c482

File tree

83 files changed

+1446
-966
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1446
-966
lines changed

alleycats-core/src/main/scala/alleycats/std/map.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ object map extends MapInstances
88
trait MapInstances {
99

1010
// toList is inconsistent. See https://github.com/typelevel/cats/issues/1831
11-
implicit def alleycatsStdInstancesForMap[K]: Traverse[Map[K, *]] =
12-
new Traverse[Map[K, *]] {
11+
implicit def alleycatsStdInstancesForMap[K]: Traverse[({ type λ[α$] = Map[K, α$] })#λ] =
12+
new Traverse[({ type λ[α$] = Map[K, α$] })#λ] {
1313

1414
def traverse[G[_], A, B](fa: Map[K, A])(f: A => G[B])(implicit G: Applicative[G]): G[Map[K, B]] = {
1515
val gba: Eval[G[Map[K, B]]] = Always(G.pure(Map.empty))
@@ -59,9 +59,9 @@ trait MapInstances {
5959
collectFirst(fa)(Function.unlift(f))
6060
}
6161

62-
implicit def alleycatsStdMapTraverseFilter[K]: TraverseFilter[Map[K, *]] =
63-
new TraverseFilter[Map[K, *]] {
64-
def traverse: Traverse[Map[K, *]] = alleycatsStdInstancesForMap
62+
implicit def alleycatsStdMapTraverseFilter[K]: TraverseFilter[({ type λ[α$] = Map[K, α$] })#λ] =
63+
new TraverseFilter[({ type λ[α$] = Map[K, α$] })#λ] {
64+
def traverse: Traverse[({ type λ[α$] = Map[K, α$] })#λ] = alleycatsStdInstancesForMap
6565

6666
def traverseFilter[G[_], A, B](fa: Map[K, A])(f: A => G[Option[B]])(implicit G: Applicative[G]): G[Map[K, B]] = {
6767
val gba: Eval[G[Map[K, B]]] = Always(G.pure(Map.empty))

core/src/main/scala-2.12/cats/data/OneAndLowPriority4.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import scala.annotation.tailrec
55
import scala.collection.mutable.Builder
66

77
abstract private[data] class OneAndLowPriority4 {
8-
implicit val catsDataComonadForNonEmptyStream: Comonad[OneAnd[Stream, *]] =
9-
new Comonad[OneAnd[Stream, *]] {
8+
implicit val catsDataComonadForNonEmptyStream: Comonad[({ type λ[α$] = OneAnd[Stream, α$] })#λ] =
9+
new Comonad[({ type λ[α$] = OneAnd[Stream, α$] })#λ] {
1010
def coflatMap[A, B](fa: OneAnd[Stream, A])(f: OneAnd[Stream, A] => B): OneAnd[Stream, B] = {
1111
@tailrec def consume(as: Stream[A], buf: Builder[B, Stream[B]]): Stream[B] =
1212
if (as.isEmpty) buf.result

core/src/main/scala-2.12/cats/instances/ScalaVersionSpecificParallelInstances.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ import cats.{NonEmptyParallel, Parallel}
88
trait ParallelInstances extends ParallelInstances1 {
99

1010
@deprecated("Use cats.instances.either.catsParallelForEitherAndValidated", "2.1.0")
11-
def catsParallelForEitherValidated[E: Semigroup]: Parallel.Aux[Either[E, *], Validated[E, *]] =
11+
def catsParallelForEitherValidated[E: Semigroup]
12+
: Parallel.Aux[({ type λ[α$] = Either[E, α$] })#λ, ({ type λ[α$] = Validated[E, α$] })#λ] =
1213
cats.instances.either.catsParallelForEitherAndValidated[E]
1314

1415
@deprecated("Use OptionT.catsDataParallelForOptionT", "2.0.0")
1516
def catsParallelForOptionTNestedOption[M[_]](
1617
implicit P: Parallel[M]
17-
): Parallel.Aux[OptionT[M, *], Nested[P.F, Option, *]] = OptionT.catsDataParallelForOptionT[M]
18+
): Parallel.Aux[({ type λ[α$] = OptionT[M, α$] })#λ, ({ type λ[α$] = Nested[P.F, Option, α$] })#λ] =
19+
OptionT.catsDataParallelForOptionT[M]
1820

1921
@deprecated("Use cats.instances.list.catsStdNonEmptyParallelForListZipList", "2.1.0")
2022
def catsStdNonEmptyParallelForZipList: NonEmptyParallel.Aux[List, ZipList] =
@@ -31,6 +33,7 @@ trait ParallelInstances extends ParallelInstances1 {
3133
@deprecated("Use EitherT.catsDataParallelForEitherTWithParallelEffect", "2.0.0")
3234
def catsParallelForEitherTNestedParallelValidated[M[_], E: Semigroup](
3335
implicit P: Parallel[M]
34-
): Parallel.Aux[EitherT[M, E, *], Nested[P.F, Validated[E, *], *]] =
36+
): Parallel.Aux[({ type λ[α$] = EitherT[M, E, α$] })#λ,
37+
({ type λ[α$] = Nested[P.F, ({ type λ[α$$] = Validated[E, α$$] })#λ, α$] })#λ] =
3538
EitherT.catsDataParallelForEitherTWithParallelEffect[M, E]
3639
}

core/src/main/scala-2.12/cats/instances/stream.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ trait StreamInstances extends cats.kernel.instances.StreamInstances {
176176
def applicative: Applicative[ZipStream] = ZipStream.catsDataAlternativeForZipStream
177177

178178
def sequential: ZipStream ~> Stream =
179-
λ[ZipStream ~> Stream](_.value)
179+
new (ZipStream ~> Stream) { def apply[A$](a$ : ZipStream[A$]): Stream[A$] = a$.value }
180180

181181
def parallel: Stream ~> ZipStream =
182-
λ[Stream ~> ZipStream](v => new ZipStream(v))
182+
new (Stream ~> ZipStream) { def apply[A$](v: Stream[A$]): ZipStream[A$] = new ZipStream(v) }
183183
}
184184
}
185185

core/src/main/scala-2.13+/cats/data/NonEmptyLazyList.scala

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -377,21 +377,25 @@ sealed abstract private[data] class NonEmptyLazyListInstances extends NonEmptyLa
377377
implicit def catsDataShowForNonEmptyLazyList[A](implicit A: Show[A]): Show[NonEmptyLazyList[A]] =
378378
Show.show[NonEmptyLazyList[A]](nell => s"NonEmpty${Show[LazyList[A]].show(nell.toLazyList)}")
379379

380-
implicit def catsDataParallelForNonEmptyLazyList: Parallel.Aux[NonEmptyLazyList, OneAnd[ZipLazyList, *]] =
380+
implicit def catsDataParallelForNonEmptyLazyList
381+
: Parallel.Aux[NonEmptyLazyList, ({ type λ[α$] = OneAnd[ZipLazyList, α$] })#λ] =
381382
new Parallel[NonEmptyLazyList] {
382383
type F[x] = OneAnd[ZipLazyList, x]
383384

384-
def applicative: Applicative[OneAnd[ZipLazyList, *]] =
385+
def applicative: Applicative[({ type λ[α$] = OneAnd[ZipLazyList, α$] })#λ] =
385386
OneAnd.catsDataApplicativeForOneAnd(ZipLazyList.catsDataAlternativeForZipLazyList)
386387
def monad: Monad[NonEmptyLazyList] = NonEmptyLazyList.catsDataInstancesForNonEmptyLazyList
387388

388-
def sequential: OneAnd[ZipLazyList, *] ~> NonEmptyLazyList =
389-
λ[OneAnd[ZipLazyList, *] ~> NonEmptyLazyList](
390-
znell => NonEmptyLazyList.fromLazyListPrepend(znell.head, znell.tail.value)
391-
)
389+
def sequential: ({ type λ[α$] = OneAnd[ZipLazyList, α$] })#λ ~> NonEmptyLazyList =
390+
new (({ type λ[α$] = OneAnd[ZipLazyList, α$] })#λ ~> NonEmptyLazyList) {
391+
def apply[A$](znell: OneAnd[ZipLazyList, A$]): NonEmptyLazyList[A$] =
392+
NonEmptyLazyList.fromLazyListPrepend(znell.head, znell.tail.value)
393+
}
392394

393-
def parallel: NonEmptyLazyList ~> OneAnd[ZipLazyList, *] =
394-
λ[NonEmptyLazyList ~> OneAnd[ZipLazyList, *]](nell => OneAnd(nell.head, ZipLazyList(nell.tail)))
395+
def parallel: NonEmptyLazyList ~> ({ type λ[α$] = OneAnd[ZipLazyList, α$] })#λ =
396+
new (NonEmptyLazyList ~> ({ type λ[α$] = OneAnd[ZipLazyList, α$] })#λ) {
397+
def apply[A$](nell: NonEmptyLazyList[A$]): OneAnd[ZipLazyList, A$] = OneAnd(nell.head, ZipLazyList(nell.tail))
398+
}
395399
}
396400
}
397401

core/src/main/scala-2.13+/cats/data/OneAndLowPriority4.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import scala.collection.mutable.Builder
66

77
abstract private[data] class OneAndLowPriority4 {
88
@deprecated("Use catsDataComonadForNonEmptyLazyList", "2.0.0-RC2")
9-
implicit def catsDataComonadForNonEmptyStream: Comonad[OneAnd[Stream, *]] =
10-
new Comonad[OneAnd[Stream, *]] {
9+
implicit def catsDataComonadForNonEmptyStream: Comonad[({ type λ[α$] = OneAnd[Stream, α$] })#λ] =
10+
new Comonad[({ type λ[α$] = OneAnd[Stream, α$] })#λ] {
1111
def coflatMap[A, B](fa: OneAnd[Stream, A])(f: OneAnd[Stream, A] => B): OneAnd[Stream, B] = {
1212
@tailrec def consume(as: Stream[A], buf: Builder[B, Stream[B]]): Stream[B] =
1313
if (as.isEmpty) buf.result
@@ -25,8 +25,8 @@ abstract private[data] class OneAndLowPriority4 {
2525
fa.map(f)(cats.instances.stream.catsStdInstancesForStream)
2626
}
2727

28-
implicit val catsDataComonadForNonEmptyLazyList: Comonad[OneAnd[LazyList, *]] =
29-
new Comonad[OneAnd[LazyList, *]] {
28+
implicit val catsDataComonadForNonEmptyLazyList: Comonad[({ type λ[α$] = OneAnd[LazyList, α$] })#λ] =
29+
new Comonad[({ type λ[α$] = OneAnd[LazyList, α$] })#λ] {
3030
def coflatMap[A, B](fa: OneAnd[LazyList, A])(f: OneAnd[LazyList, A] => B): OneAnd[LazyList, B] = {
3131
@tailrec def consume(as: LazyList[A], buf: Builder[B, LazyList[B]]): LazyList[B] =
3232
if (as.isEmpty) buf.result

core/src/main/scala-2.13+/cats/instances/ScalaVersionSpecificParallelInstances.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ import cats.{NonEmptyParallel, Parallel}
99
trait ParallelInstances extends ParallelInstances1 {
1010

1111
@deprecated("Use cats.instances.either.catsParallelForEitherAndValidated", "2.1.0")
12-
def catsParallelForEitherValidated[E: Semigroup]: Parallel.Aux[Either[E, *], Validated[E, *]] =
12+
def catsParallelForEitherValidated[E: Semigroup]
13+
: Parallel.Aux[({ type λ[α$] = Either[E, α$] })#λ, ({ type λ[α$] = Validated[E, α$] })#λ] =
1314
cats.instances.either.catsParallelForEitherAndValidated[E]
1415

1516
@deprecated("Use OptionT.catsDataParallelForOptionT", "2.0.0")
1617
def catsParallelForOptionTNestedOption[M[_]](
1718
implicit P: Parallel[M]
18-
): Parallel.Aux[OptionT[M, *], Nested[P.F, Option, *]] = OptionT.catsDataParallelForOptionT[M]
19+
): Parallel.Aux[({ type λ[α$] = OptionT[M, α$] })#λ, ({ type λ[α$] = Nested[P.F, Option, α$] })#λ] =
20+
OptionT.catsDataParallelForOptionT[M]
1921

2022
@deprecated("Use cats.instances.list.catsStdNonEmptyParallelForListZipList", "2.1.0")
2123
def catsStdNonEmptyParallelForZipList: NonEmptyParallel.Aux[List, ZipList] =
@@ -36,6 +38,7 @@ trait ParallelInstances extends ParallelInstances1 {
3638
@deprecated("Use EitherT.catsDataParallelForEitherTWithParallelEffect", "2.0.0")
3739
def catsParallelForEitherTNestedParallelValidated[M[_], E: Semigroup](
3840
implicit P: Parallel[M]
39-
): Parallel.Aux[EitherT[M, E, *], Nested[P.F, Validated[E, *], *]] =
41+
): Parallel.Aux[({ type λ[α$] = EitherT[M, E, α$] })#λ,
42+
({ type λ[α$] = Nested[P.F, ({ type λ[α$$] = Validated[E, α$$] })#λ, α$] })#λ] =
4043
EitherT.catsDataParallelForEitherTWithParallelEffect[M, E]
4144
}

core/src/main/scala-2.13+/cats/instances/lazyList.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ trait LazyListInstances extends cats.kernel.instances.LazyListInstances {
182182
def applicative: Applicative[ZipLazyList] = ZipLazyList.catsDataAlternativeForZipLazyList
183183

184184
def sequential: ZipLazyList ~> LazyList =
185-
λ[ZipLazyList ~> LazyList](_.value)
185+
new (ZipLazyList ~> LazyList) { def apply[A$](a$ : ZipLazyList[A$]): LazyList[A$] = a$.value }
186186

187187
def parallel: LazyList ~> ZipLazyList =
188-
λ[LazyList ~> ZipLazyList](v => new ZipLazyList(v))
188+
new (LazyList ~> ZipLazyList) { def apply[A$](v: LazyList[A$]): ZipLazyList[A$] = new ZipLazyList(v) }
189189
}
190190
}

core/src/main/scala-2.13+/cats/instances/stream.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ trait StreamInstances extends cats.kernel.instances.StreamInstances {
179179
def applicative: Applicative[ZipStream] = ZipStream.catsDataAlternativeForZipStream
180180

181181
def sequential: ZipStream ~> Stream =
182-
λ[ZipStream ~> Stream](_.value)
182+
new (ZipStream ~> Stream) { def apply[A$](a$ : ZipStream[A$]): Stream[A$] = a$.value }
183183

184184
def parallel: Stream ~> ZipStream =
185-
λ[Stream ~> ZipStream](v => new ZipStream(v))
185+
new (Stream ~> ZipStream) { def apply[A$](v: Stream[A$]): ZipStream[A$] = new ZipStream(v) }
186186
}
187187
}
188188

core/src/main/scala/cats/Alternative.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ import scala.annotation.implicitNotFound
8383
def guard(condition: Boolean): F[Unit] =
8484
if (condition) unit else empty
8585

86-
override def compose[G[_]: Applicative]: Alternative[λ[α => F[G[α]]]] =
86+
override def compose[G[_]: Applicative]: Alternative[({ type λ] = F[G[α]] })#λ] =
8787
new ComposedAlternative[F, G] {
8888
val F = self
8989
val G = Applicative[G]

0 commit comments

Comments
 (0)