From 77ee73837275b00ac4ef99eca3ce8a8de7fdd292 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Wed, 17 Jun 2020 08:03:49 -0500 Subject: [PATCH 1/6] Use Scalafmt 2.6.0-friendly Simulacrum banners --- alleycats-core/src/main/scala/alleycats/ConsK.scala | 8 ++++---- alleycats-core/src/main/scala/alleycats/Empty.scala | 8 ++++---- alleycats-core/src/main/scala/alleycats/EmptyK.scala | 8 ++++---- alleycats-core/src/main/scala/alleycats/Extract.scala | 8 ++++---- alleycats-core/src/main/scala/alleycats/One.scala | 8 ++++---- alleycats-core/src/main/scala/alleycats/Pure.scala | 8 ++++---- alleycats-core/src/main/scala/alleycats/Zero.scala | 8 ++++---- core/src/main/scala/cats/Align.scala | 8 ++++---- core/src/main/scala/cats/Alternative.scala | 8 ++++---- core/src/main/scala/cats/Applicative.scala | 8 ++++---- core/src/main/scala/cats/Apply.scala | 8 ++++---- core/src/main/scala/cats/Bifoldable.scala | 8 ++++---- core/src/main/scala/cats/Bifunctor.scala | 8 ++++---- core/src/main/scala/cats/Bimonad.scala | 8 ++++---- core/src/main/scala/cats/Bitraverse.scala | 8 ++++---- core/src/main/scala/cats/CoflatMap.scala | 8 ++++---- core/src/main/scala/cats/CommutativeApplicative.scala | 8 ++++---- core/src/main/scala/cats/CommutativeApply.scala | 8 ++++---- core/src/main/scala/cats/CommutativeFlatMap.scala | 8 ++++---- core/src/main/scala/cats/CommutativeMonad.scala | 8 ++++---- core/src/main/scala/cats/Comonad.scala | 8 ++++---- core/src/main/scala/cats/Contravariant.scala | 8 ++++---- core/src/main/scala/cats/ContravariantMonoidal.scala | 8 ++++---- core/src/main/scala/cats/ContravariantSemigroupal.scala | 8 ++++---- core/src/main/scala/cats/Distributive.scala | 8 ++++---- core/src/main/scala/cats/FlatMap.scala | 8 ++++---- core/src/main/scala/cats/Foldable.scala | 8 ++++---- core/src/main/scala/cats/Functor.scala | 8 ++++---- core/src/main/scala/cats/FunctorFilter.scala | 8 ++++---- core/src/main/scala/cats/Invariant.scala | 8 ++++---- core/src/main/scala/cats/InvariantMonoidal.scala | 8 ++++---- core/src/main/scala/cats/InvariantSemigroupal.scala | 8 ++++---- core/src/main/scala/cats/Monad.scala | 8 ++++---- core/src/main/scala/cats/MonoidK.scala | 8 ++++---- core/src/main/scala/cats/NonEmptyTraverse.scala | 8 ++++---- core/src/main/scala/cats/Reducible.scala | 8 ++++---- core/src/main/scala/cats/SemigroupK.scala | 8 ++++---- core/src/main/scala/cats/Semigroupal.scala | 8 ++++---- core/src/main/scala/cats/Traverse.scala | 8 ++++---- core/src/main/scala/cats/TraverseFilter.scala | 8 ++++---- core/src/main/scala/cats/UnorderedFoldable.scala | 8 ++++---- core/src/main/scala/cats/UnorderedTraverse.scala | 8 ++++---- core/src/main/scala/cats/arrow/Arrow.scala | 8 ++++---- core/src/main/scala/cats/arrow/ArrowChoice.scala | 8 ++++---- core/src/main/scala/cats/arrow/Category.scala | 8 ++++---- core/src/main/scala/cats/arrow/Choice.scala | 8 ++++---- core/src/main/scala/cats/arrow/CommutativeArrow.scala | 8 ++++---- core/src/main/scala/cats/arrow/Compose.scala | 8 ++++---- core/src/main/scala/cats/arrow/Profunctor.scala | 8 ++++---- core/src/main/scala/cats/arrow/Strong.scala | 8 ++++---- 50 files changed, 200 insertions(+), 200 deletions(-) diff --git a/alleycats-core/src/main/scala/alleycats/ConsK.scala b/alleycats-core/src/main/scala/alleycats/ConsK.scala index 0c5b939249..990cb86adf 100644 --- a/alleycats-core/src/main/scala/alleycats/ConsK.scala +++ b/alleycats-core/src/main/scala/alleycats/ConsK.scala @@ -15,9 +15,9 @@ object ConsK { def cons[A](hd: A, tl: F[A]): F[A] = s.combineK(p.pure(hd), tl) } - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[ConsK]] for `F`. @@ -54,8 +54,8 @@ object ConsK { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/alleycats-core/src/main/scala/alleycats/Empty.scala b/alleycats-core/src/main/scala/alleycats/Empty.scala index e66c795c4c..13f4597e42 100644 --- a/alleycats-core/src/main/scala/alleycats/Empty.scala +++ b/alleycats-core/src/main/scala/alleycats/Empty.scala @@ -23,9 +23,9 @@ object Empty extends EmptyInstances0 { def fromEmptyK[F[_], T](implicit ekf: EmptyK[F]): Empty[F[T]] = ekf.synthesize[T] - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Empty]] for `A`. @@ -64,9 +64,9 @@ object Empty extends EmptyInstances0 { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/alleycats-core/src/main/scala/alleycats/EmptyK.scala b/alleycats-core/src/main/scala/alleycats/EmptyK.scala index 39d597c08c..6b0a971772 100644 --- a/alleycats-core/src/main/scala/alleycats/EmptyK.scala +++ b/alleycats-core/src/main/scala/alleycats/EmptyK.scala @@ -15,9 +15,9 @@ import scala.annotation.implicitNotFound object EmptyK { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[EmptyK]] for `F`. @@ -54,8 +54,8 @@ object EmptyK { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/alleycats-core/src/main/scala/alleycats/Extract.scala b/alleycats-core/src/main/scala/alleycats/Extract.scala index c22ec5f254..4e0d2ba6ee 100644 --- a/alleycats-core/src/main/scala/alleycats/Extract.scala +++ b/alleycats-core/src/main/scala/alleycats/Extract.scala @@ -25,9 +25,9 @@ object Extract { def coflatMap[A, B](fa: F[A])(f: F[A] => B): F[B] = cf.coflatMap(fa)(f) } - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Extract]] for `F`. @@ -65,8 +65,8 @@ object Extract { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/alleycats-core/src/main/scala/alleycats/One.scala b/alleycats-core/src/main/scala/alleycats/One.scala index b58953bedf..e7a49a796c 100644 --- a/alleycats-core/src/main/scala/alleycats/One.scala +++ b/alleycats-core/src/main/scala/alleycats/One.scala @@ -20,9 +20,9 @@ object One { def apply[A](a: => A): One[A] = new One[A] { lazy val one: A = a } - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[One]] for `A`. @@ -61,8 +61,8 @@ object One { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/alleycats-core/src/main/scala/alleycats/Pure.scala b/alleycats-core/src/main/scala/alleycats/Pure.scala index 1a82449658..4bb64117ab 100644 --- a/alleycats-core/src/main/scala/alleycats/Pure.scala +++ b/alleycats-core/src/main/scala/alleycats/Pure.scala @@ -25,9 +25,9 @@ object Pure { def tailRecM[A, B](a: A)(f: (A) => F[Either[A, B]]): F[B] = fm.tailRecM(a)(f) } - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Pure]] for `F`. @@ -64,8 +64,8 @@ object Pure { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/alleycats-core/src/main/scala/alleycats/Zero.scala b/alleycats-core/src/main/scala/alleycats/Zero.scala index 7961e2d588..eb0472b770 100644 --- a/alleycats-core/src/main/scala/alleycats/Zero.scala +++ b/alleycats-core/src/main/scala/alleycats/Zero.scala @@ -21,9 +21,9 @@ object Zero { def apply[A](a: => A): Zero[A] = new Zero[A] { lazy val zero: A = a } - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Zero]] for `A`. @@ -62,8 +62,8 @@ object Zero { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/Align.scala b/core/src/main/scala/cats/Align.scala index 4b4eb73f26..0ecd8e5abc 100644 --- a/core/src/main/scala/cats/Align.scala +++ b/core/src/main/scala/cats/Align.scala @@ -130,9 +130,9 @@ object Align extends ScalaVersionSpecificAlignInstances { ) } - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Align]] for `F`. @@ -176,8 +176,8 @@ object Align extends ScalaVersionSpecificAlignInstances { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/Alternative.scala b/core/src/main/scala/cats/Alternative.scala index dec2659d9a..00b1947f34 100644 --- a/core/src/main/scala/cats/Alternative.scala +++ b/core/src/main/scala/cats/Alternative.scala @@ -92,9 +92,9 @@ import scala.annotation.implicitNotFound object Alternative { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Alternative]] for `F`. @@ -139,8 +139,8 @@ object Alternative { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/Applicative.scala b/core/src/main/scala/cats/Applicative.scala index b728169aec..74a3fa066d 100644 --- a/core/src/main/scala/cats/Applicative.scala +++ b/core/src/main/scala/cats/Applicative.scala @@ -230,9 +230,9 @@ object Applicative { def map[A, B](fa: F[A])(f: A => B): F[B] = F.map(fa)(f) } - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Applicative]] for `F`. @@ -271,9 +271,9 @@ object Applicative { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/Apply.scala b/core/src/main/scala/cats/Apply.scala index 52541b40b4..54dd613098 100644 --- a/core/src/main/scala/cats/Apply.scala +++ b/core/src/main/scala/cats/Apply.scala @@ -267,9 +267,9 @@ object Apply { def functor: Functor[F] = Apply[F] } - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Apply]] for `F`. @@ -320,9 +320,9 @@ object Apply { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/Bifoldable.scala b/core/src/main/scala/cats/Bifoldable.scala index 0d32ad7a61..241d989a69 100644 --- a/core/src/main/scala/cats/Bifoldable.scala +++ b/core/src/main/scala/cats/Bifoldable.scala @@ -38,9 +38,9 @@ object Bifoldable { implicit def catsBitraverseForEither: Bitraverse[Either] = cats.instances.either.catsStdBitraverseForEither implicit def catsBitraverseForTuple2: Bitraverse[Tuple2] = cats.instances.tuple.catsStdBitraverseForTuple2 - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Bifoldable]] for `F`. @@ -83,9 +83,9 @@ object Bifoldable { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/Bifunctor.scala b/core/src/main/scala/cats/Bifunctor.scala index 09f1131fe8..d635938ad5 100644 --- a/core/src/main/scala/cats/Bifunctor.scala +++ b/core/src/main/scala/cats/Bifunctor.scala @@ -61,9 +61,9 @@ object Bifunctor { implicit def catsBifunctorForEither: Bifunctor[Either] = cats.instances.either.catsStdBitraverseForEither implicit def catsBifunctorForTuple2: Bifunctor[Tuple2] = cats.instances.tuple.catsStdBitraverseForTuple2 - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Bifunctor]] for `F`. @@ -103,9 +103,9 @@ object Bifunctor { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/Bimonad.scala b/core/src/main/scala/cats/Bimonad.scala index 43cbeb46f8..3996a000de 100644 --- a/core/src/main/scala/cats/Bimonad.scala +++ b/core/src/main/scala/cats/Bimonad.scala @@ -8,9 +8,9 @@ import scala.annotation.implicitNotFound object Bimonad { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Bimonad]] for `F`. @@ -49,8 +49,8 @@ object Bimonad { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/Bitraverse.scala b/core/src/main/scala/cats/Bitraverse.scala index b45d10837a..05e45fd967 100644 --- a/core/src/main/scala/cats/Bitraverse.scala +++ b/core/src/main/scala/cats/Bitraverse.scala @@ -113,9 +113,9 @@ import scala.annotation.implicitNotFound object Bitraverse { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Bitraverse]] for `F`. @@ -158,9 +158,9 @@ object Bitraverse { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/CoflatMap.scala b/core/src/main/scala/cats/CoflatMap.scala index 8386c131a0..5c1d6e541c 100644 --- a/core/src/main/scala/cats/CoflatMap.scala +++ b/core/src/main/scala/cats/CoflatMap.scala @@ -50,9 +50,9 @@ import scala.annotation.implicitNotFound object CoflatMap { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[CoflatMap]] for `F`. @@ -93,8 +93,8 @@ object CoflatMap { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/CommutativeApplicative.scala b/core/src/main/scala/cats/CommutativeApplicative.scala index 49b7ac83cc..1d53392b12 100644 --- a/core/src/main/scala/cats/CommutativeApplicative.scala +++ b/core/src/main/scala/cats/CommutativeApplicative.scala @@ -28,9 +28,9 @@ object CommutativeApplicative { .map2(x, y)(CommutativeMonoid[A].combine) } - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[CommutativeApplicative]] for `F`. @@ -71,8 +71,8 @@ object CommutativeApplicative { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/CommutativeApply.scala b/core/src/main/scala/cats/CommutativeApply.scala index 2697577bc5..3a5d642238 100644 --- a/core/src/main/scala/cats/CommutativeApply.scala +++ b/core/src/main/scala/cats/CommutativeApply.scala @@ -24,9 +24,9 @@ object CommutativeApply { .map2(x, y)(CommutativeSemigroup[A].combine) } - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[CommutativeApply]] for `F`. @@ -65,8 +65,8 @@ object CommutativeApply { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/CommutativeFlatMap.scala b/core/src/main/scala/cats/CommutativeFlatMap.scala index ed9ee7660a..c631d8734d 100644 --- a/core/src/main/scala/cats/CommutativeFlatMap.scala +++ b/core/src/main/scala/cats/CommutativeFlatMap.scala @@ -17,9 +17,9 @@ import scala.annotation.implicitNotFound object CommutativeFlatMap { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[CommutativeFlatMap]] for `F`. @@ -58,8 +58,8 @@ object CommutativeFlatMap { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/CommutativeMonad.scala b/core/src/main/scala/cats/CommutativeMonad.scala index f19c1237f0..6efee4390f 100644 --- a/core/src/main/scala/cats/CommutativeMonad.scala +++ b/core/src/main/scala/cats/CommutativeMonad.scala @@ -17,9 +17,9 @@ import scala.annotation.implicitNotFound object CommutativeMonad { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[CommutativeMonad]] for `F`. @@ -62,8 +62,8 @@ object CommutativeMonad { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/Comonad.scala b/core/src/main/scala/cats/Comonad.scala index c95477053a..698b1e64a0 100644 --- a/core/src/main/scala/cats/Comonad.scala +++ b/core/src/main/scala/cats/Comonad.scala @@ -32,9 +32,9 @@ import scala.annotation.implicitNotFound object Comonad { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Comonad]] for `F`. @@ -74,8 +74,8 @@ object Comonad { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/Contravariant.scala b/core/src/main/scala/cats/Contravariant.scala index 2790ee5151..d55935d982 100644 --- a/core/src/main/scala/cats/Contravariant.scala +++ b/core/src/main/scala/cats/Contravariant.scala @@ -33,9 +33,9 @@ import scala.annotation.implicitNotFound object Contravariant { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Contravariant]] for `F`. @@ -76,8 +76,8 @@ object Contravariant { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/ContravariantMonoidal.scala b/core/src/main/scala/cats/ContravariantMonoidal.scala index ffa853a715..2a0e48fdec 100644 --- a/core/src/main/scala/cats/ContravariantMonoidal.scala +++ b/core/src/main/scala/cats/ContravariantMonoidal.scala @@ -27,9 +27,9 @@ object ContravariantMonoidal extends SemigroupalArityFunctions { def monoid[F[_], A](implicit f: ContravariantMonoidal[F]): Monoid[F[A]] = new ContravariantMonoidalMonoid[F, A](f) - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[ContravariantMonoidal]] for `F`. @@ -73,9 +73,9 @@ object ContravariantMonoidal extends SemigroupalArityFunctions { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/ContravariantSemigroupal.scala b/core/src/main/scala/cats/ContravariantSemigroupal.scala index a695b88d6e..62fe3ba350 100644 --- a/core/src/main/scala/cats/ContravariantSemigroupal.scala +++ b/core/src/main/scala/cats/ContravariantSemigroupal.scala @@ -21,9 +21,9 @@ object ContravariantSemigroupal extends SemigroupalArityFunctions { def semigroup[F[_], A](implicit f: ContravariantSemigroupal[F]): Semigroup[F[A]] = new ContravariantSemigroupalSemigroup[F, A](f) - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[ContravariantSemigroupal]] for `F`. @@ -66,9 +66,9 @@ object ContravariantSemigroupal extends SemigroupalArityFunctions { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/Distributive.scala b/core/src/main/scala/cats/Distributive.scala index de4bfcde0e..8facb98724 100644 --- a/core/src/main/scala/cats/Distributive.scala +++ b/core/src/main/scala/cats/Distributive.scala @@ -25,9 +25,9 @@ import scala.annotation.implicitNotFound object Distributive { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Distributive]] for `F`. @@ -66,8 +66,8 @@ object Distributive { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/FlatMap.scala b/core/src/main/scala/cats/FlatMap.scala index 7b70c32401..f813366064 100644 --- a/core/src/main/scala/cats/FlatMap.scala +++ b/core/src/main/scala/cats/FlatMap.scala @@ -202,9 +202,9 @@ import scala.annotation.implicitNotFound object FlatMap { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[FlatMap]] for `F`. @@ -249,8 +249,8 @@ object FlatMap { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/Foldable.scala b/core/src/main/scala/cats/Foldable.scala index c2162435b5..58ae4d7dc2 100644 --- a/core/src/main/scala/cats/Foldable.scala +++ b/core/src/main/scala/cats/Foldable.scala @@ -912,9 +912,9 @@ object Foldable { F.foldRight[A, Source[A]](fa, Now(Empty))((a, evalSrc) => Later(cons(a, evalSrc))).value } - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Foldable]] for `F`. @@ -1005,8 +1005,8 @@ object Foldable { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/Functor.scala b/core/src/main/scala/cats/Functor.scala index 6baf48f96d..964d89f53c 100644 --- a/core/src/main/scala/cats/Functor.scala +++ b/core/src/main/scala/cats/Functor.scala @@ -207,9 +207,9 @@ import scala.annotation.implicitNotFound object Functor { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Functor]] for `F`. @@ -257,8 +257,8 @@ object Functor { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/FunctorFilter.scala b/core/src/main/scala/cats/FunctorFilter.scala index 4dbe079a59..d5a7bd956b 100644 --- a/core/src/main/scala/cats/FunctorFilter.scala +++ b/core/src/main/scala/cats/FunctorFilter.scala @@ -91,9 +91,9 @@ object FunctorFilter extends ScalaVersionSpecificTraverseFilterInstances { implicit def catsTraverseFilterForQueue: TraverseFilter[Queue] = cats.instances.queue.catsStdTraverseFilterForQueue - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[FunctorFilter]] for `F`. @@ -136,8 +136,8 @@ object FunctorFilter extends ScalaVersionSpecificTraverseFilterInstances { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/Invariant.scala b/core/src/main/scala/cats/Invariant.scala index 20aaf97a8d..f07993d5c0 100644 --- a/core/src/main/scala/cats/Invariant.scala +++ b/core/src/main/scala/cats/Invariant.scala @@ -183,9 +183,9 @@ object Invariant extends ScalaVersionSpecificInvariantInstances with InvariantIn } - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Invariant]] for `F`. @@ -223,9 +223,9 @@ object Invariant extends ScalaVersionSpecificInvariantInstances with InvariantIn } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/InvariantMonoidal.scala b/core/src/main/scala/cats/InvariantMonoidal.scala index 59692cda1b..ca3d45ad39 100644 --- a/core/src/main/scala/cats/InvariantMonoidal.scala +++ b/core/src/main/scala/cats/InvariantMonoidal.scala @@ -36,9 +36,9 @@ object InvariantMonoidal { def monoid[F[_], A](implicit F: InvariantMonoidal[F], A: Monoid[A]): Monoid[F[A]] = new InvariantMonoidalMonoid[F, A](F, A) - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[InvariantMonoidal]] for `F`. @@ -77,9 +77,9 @@ object InvariantMonoidal { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/InvariantSemigroupal.scala b/core/src/main/scala/cats/InvariantSemigroupal.scala index 2022b36dcb..1455b4cbe1 100644 --- a/core/src/main/scala/cats/InvariantSemigroupal.scala +++ b/core/src/main/scala/cats/InvariantSemigroupal.scala @@ -26,9 +26,9 @@ object InvariantSemigroupal extends SemigroupalArityFunctions { def semigroup[F[_], A](implicit F: InvariantSemigroupal[F], A: Semigroup[A]): Semigroup[F[A]] = new InvariantSemigroupalSemigroup[F, A](F, A) - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[InvariantSemigroupal]] for `F`. @@ -69,9 +69,9 @@ object InvariantSemigroupal extends SemigroupalArityFunctions { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/Monad.scala b/core/src/main/scala/cats/Monad.scala index 396b4916b2..3e1faf1ab0 100644 --- a/core/src/main/scala/cats/Monad.scala +++ b/core/src/main/scala/cats/Monad.scala @@ -121,9 +121,9 @@ import scala.annotation.implicitNotFound object Monad { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Monad]] for `F`. @@ -167,8 +167,8 @@ object Monad { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/MonoidK.scala b/core/src/main/scala/cats/MonoidK.scala index affb8ce018..4c8c5605ac 100644 --- a/core/src/main/scala/cats/MonoidK.scala +++ b/core/src/main/scala/cats/MonoidK.scala @@ -55,9 +55,9 @@ import scala.annotation.implicitNotFound object MonoidK { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[MonoidK]] for `F`. @@ -96,8 +96,8 @@ object MonoidK { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/NonEmptyTraverse.scala b/core/src/main/scala/cats/NonEmptyTraverse.scala index a6bdcb4b56..c287f017b8 100644 --- a/core/src/main/scala/cats/NonEmptyTraverse.scala +++ b/core/src/main/scala/cats/NonEmptyTraverse.scala @@ -98,9 +98,9 @@ import scala.annotation.implicitNotFound object NonEmptyTraverse { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[NonEmptyTraverse]] for `F`. @@ -147,8 +147,8 @@ object NonEmptyTraverse { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/Reducible.scala b/core/src/main/scala/cats/Reducible.scala index 1572fb117b..5d9955e24d 100644 --- a/core/src/main/scala/cats/Reducible.scala +++ b/core/src/main/scala/cats/Reducible.scala @@ -286,9 +286,9 @@ import scala.annotation.implicitNotFound object Reducible { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Reducible]] for `F`. @@ -354,9 +354,9 @@ object Reducible { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/SemigroupK.scala b/core/src/main/scala/cats/SemigroupK.scala index 475e28ea8e..92bd6230fc 100644 --- a/core/src/main/scala/cats/SemigroupK.scala +++ b/core/src/main/scala/cats/SemigroupK.scala @@ -134,9 +134,9 @@ object SemigroupK extends ScalaVersionSpecificMonoidKInstances { cats.instances.sortedMap.catsStdMonoidKForSortedMap[K] implicit def catsMonoidKForEndo: MonoidK[Endo] = cats.instances.function.catsStdMonoidKForFunction1 - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[SemigroupK]] for `F`. @@ -177,8 +177,8 @@ object SemigroupK extends ScalaVersionSpecificMonoidKInstances { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/Semigroupal.scala b/core/src/main/scala/cats/Semigroupal.scala index f5217140f8..0044975fcd 100644 --- a/core/src/main/scala/cats/Semigroupal.scala +++ b/core/src/main/scala/cats/Semigroupal.scala @@ -84,9 +84,9 @@ object Semigroupal extends ScalaVersionSpecificSemigroupalInstances with Semigro implicit val catsSemigroupalForCommutativeSemigroup: Semigroupal[CommutativeSemigroup] = cats.instances.invariant.catsInvariantMonoidalCommutativeSemigroup - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Semigroupal]] for `F`. @@ -124,8 +124,8 @@ object Semigroupal extends ScalaVersionSpecificSemigroupalInstances with Semigro } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/Traverse.scala b/core/src/main/scala/cats/Traverse.scala index 21f6d9a6d2..97f12df3fa 100644 --- a/core/src/main/scala/cats/Traverse.scala +++ b/core/src/main/scala/cats/Traverse.scala @@ -135,9 +135,9 @@ import scala.annotation.implicitNotFound object Traverse { implicit def catsTraverseForEither[A]: Traverse[Either[A, *]] = cats.instances.either.catsStdInstancesForEither[A] - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Traverse]] for `F`. @@ -192,8 +192,8 @@ object Traverse { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/TraverseFilter.scala b/core/src/main/scala/cats/TraverseFilter.scala index 5dc8980b3b..05f5b48f34 100644 --- a/core/src/main/scala/cats/TraverseFilter.scala +++ b/core/src/main/scala/cats/TraverseFilter.scala @@ -90,9 +90,9 @@ trait TraverseFilter[F[_]] extends FunctorFilter[F] { object TraverseFilter { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[TraverseFilter]] for `F`. @@ -137,8 +137,8 @@ object TraverseFilter { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/UnorderedFoldable.scala b/core/src/main/scala/cats/UnorderedFoldable.scala index 6d025ec3e3..65e8c68181 100644 --- a/core/src/main/scala/cats/UnorderedFoldable.scala +++ b/core/src/main/scala/cats/UnorderedFoldable.scala @@ -114,9 +114,9 @@ object UnorderedFoldable extends ScalaVersionSpecificTraverseInstances { implicit def catsTraverseForTry: Traverse[Try] = cats.instances.try_.catsStdInstancesForTry - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[UnorderedFoldable]] for `F`. @@ -161,8 +161,8 @@ object UnorderedFoldable extends ScalaVersionSpecificTraverseInstances { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/UnorderedTraverse.scala b/core/src/main/scala/cats/UnorderedTraverse.scala index 5cdec5cb11..1780f513b9 100644 --- a/core/src/main/scala/cats/UnorderedTraverse.scala +++ b/core/src/main/scala/cats/UnorderedTraverse.scala @@ -16,9 +16,9 @@ import scala.annotation.implicitNotFound object UnorderedTraverse { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[UnorderedTraverse]] for `F`. @@ -61,8 +61,8 @@ object UnorderedTraverse { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/arrow/Arrow.scala b/core/src/main/scala/cats/arrow/Arrow.scala index 309c59b8ee..df7bc6528b 100644 --- a/core/src/main/scala/cats/arrow/Arrow.scala +++ b/core/src/main/scala/cats/arrow/Arrow.scala @@ -74,9 +74,9 @@ import scala.annotation.implicitNotFound object Arrow { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Arrow]] for `F`. @@ -119,8 +119,8 @@ object Arrow { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/arrow/ArrowChoice.scala b/core/src/main/scala/cats/arrow/ArrowChoice.scala index a6683887db..09414f7934 100644 --- a/core/src/main/scala/cats/arrow/ArrowChoice.scala +++ b/core/src/main/scala/cats/arrow/ArrowChoice.scala @@ -46,9 +46,9 @@ import scala.annotation.implicitNotFound object ArrowChoice { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[ArrowChoice]] for `F`. @@ -91,8 +91,8 @@ object ArrowChoice { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/arrow/Category.scala b/core/src/main/scala/cats/arrow/Category.scala index 4bf71a6fce..0bf101fba5 100644 --- a/core/src/main/scala/cats/arrow/Category.scala +++ b/core/src/main/scala/cats/arrow/Category.scala @@ -27,9 +27,9 @@ import scala.annotation.implicitNotFound object Category { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Category]] for `F`. @@ -68,8 +68,8 @@ object Category { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/arrow/Choice.scala b/core/src/main/scala/cats/arrow/Choice.scala index fc9bdd241d..9e68d2aecd 100644 --- a/core/src/main/scala/cats/arrow/Choice.scala +++ b/core/src/main/scala/cats/arrow/Choice.scala @@ -50,9 +50,9 @@ import scala.annotation.implicitNotFound object Choice { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Choice]] for `F`. @@ -93,8 +93,8 @@ object Choice { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/arrow/CommutativeArrow.scala b/core/src/main/scala/cats/arrow/CommutativeArrow.scala index bac86a2a5e..e40d413e50 100644 --- a/core/src/main/scala/cats/arrow/CommutativeArrow.scala +++ b/core/src/main/scala/cats/arrow/CommutativeArrow.scala @@ -15,9 +15,9 @@ import scala.annotation.implicitNotFound object CommutativeArrow { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[CommutativeArrow]] for `F`. @@ -58,8 +58,8 @@ object CommutativeArrow { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/arrow/Compose.scala b/core/src/main/scala/cats/arrow/Compose.scala index e24b964ba8..34ed1d409f 100644 --- a/core/src/main/scala/cats/arrow/Compose.scala +++ b/core/src/main/scala/cats/arrow/Compose.scala @@ -48,9 +48,9 @@ object Compose { implicit def catsInstancesForPartialFunction: ArrowChoice[PartialFunction] with CommutativeArrow[PartialFunction] = cats.instances.partialFunction.catsStdInstancesForPartialFunction - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Compose]] for `F`. @@ -91,8 +91,8 @@ object Compose { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/arrow/Profunctor.scala b/core/src/main/scala/cats/arrow/Profunctor.scala index e3412b148d..0280da5748 100644 --- a/core/src/main/scala/cats/arrow/Profunctor.scala +++ b/core/src/main/scala/cats/arrow/Profunctor.scala @@ -50,9 +50,9 @@ object Profunctor { implicit def catsStrongForPartialFunction: Strong[PartialFunction] = cats.instances.partialFunction.catsStdInstancesForPartialFunction - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Profunctor]] for `F`. @@ -92,8 +92,8 @@ object Profunctor { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } diff --git a/core/src/main/scala/cats/arrow/Strong.scala b/core/src/main/scala/cats/arrow/Strong.scala index 413d2e88c0..9bd007c79f 100644 --- a/core/src/main/scala/cats/arrow/Strong.scala +++ b/core/src/main/scala/cats/arrow/Strong.scala @@ -43,9 +43,9 @@ import scala.annotation.implicitNotFound object Strong { - /****************************************************************************/ + /* ======================================================================== */ /* THE FOLLOWING CODE IS MANAGED BY SIMULACRUM; PLEASE DO NOT EDIT!!!! */ - /****************************************************************************/ + /* ======================================================================== */ /** * Summon an instance of [[Strong]] for `F`. @@ -86,8 +86,8 @@ object Strong { } } - /****************************************************************************/ + /* ======================================================================== */ /* END OF SIMULACRUM-MANAGED CODE */ - /****************************************************************************/ + /* ======================================================================== */ } From 84325366a5c890aa38318b0592a5ffb9ae069e22 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Wed, 17 Jun 2020 08:13:21 -0500 Subject: [PATCH 2/6] Avoid exploding Scalafmt search space --- .../main/scala/cats/laws/discipline/Eq.scala | 38 ++++++++++--------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/laws/src/main/scala/cats/laws/discipline/Eq.scala b/laws/src/main/scala/cats/laws/discipline/Eq.scala index cf13b19855..9518e8e0c7 100644 --- a/laws/src/main/scala/cats/laws/discipline/Eq.scala +++ b/laws/src/main/scala/cats/laws/discipline/Eq.scala @@ -68,15 +68,19 @@ object eq { Eq.by[Band[A], (A, A) => (A, A)](f => (x, y) => (f.combine(x, y), f.combine(f.combine(x, y), y))) implicit def catsLawsEqForGroup[A](implicit ev1: Eq[(A, A) => (A, Boolean)], eqA: Eq[A]): Eq[Group[A]] = - Eq.by[Group[A], (A, A) => (A, Boolean)](f => - (x, y) => - ( - f.combine(x, y), - f.combine(f.inverse(x), x) === f.empty && f.combine(x, f.inverse(x)) === f.empty && - f.combine(f.inverse(y), y) === f.empty && f.combine(y, f.inverse(y)) === f.empty && - f.inverse(f.empty) == f.empty - ) - ) + Eq.by[Group[A], (A, A) => (A, Boolean)] { + f => + { (x, y) => + { + val xy = f.combine(x, y) + val p1 = f.combine(f.inverse(x), x) === f.empty && f.combine(x, f.inverse(x)) === f.empty + val p2 = f.combine(f.inverse(y), y) === f.empty && f.combine(y, f.inverse(y)) === f.empty + val p3 = f.inverse(f.empty) == f.empty + + (xy, p1 && p2 && p3) + } + } + } implicit def catsLawsEqForMonoid[A](implicit eqSA: Eq[Semigroup[A]], eqA: Eq[A]): Eq[Monoid[A]] = new Eq[Monoid[A]] { @@ -261,14 +265,14 @@ object eq { } val inverseEq = Eq.by[Group[A], ((A, A)) => (A, Boolean)](f => - Function.tupled((x, y) => - ( - f.combine(x, y), - f.combine(f.inverse(x), x) === f.empty && f.combine(x, f.inverse(x)) === f.empty && - f.combine(f.inverse(y), y) === f.empty && f.combine(y, f.inverse(y)) === f.empty && - f.inverse(f.empty) == f.empty - ) - ) + Function.tupled { (x, y) => + val xy = f.combine(x, y) + val p1 = f.combine(f.inverse(x), x) === f.empty && f.combine(x, f.inverse(x)) === f.empty + val p2 = f.combine(f.inverse(y), y) === f.empty && f.combine(y, f.inverse(y)) === f.empty + val p3 = f.inverse(f.empty) == f.empty + + (xy, p1 && p2 && p3) + } )(catsLawsEqForFn1[(A, A), (A, Boolean)]) Eq.instance((f, g) => eqMA.eqv(f, g) && inverseEq.eqv(f, g)) From 2b741001ce6f5eb1f81df5a41c85c84724ed78e1 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Wed, 17 Jun 2020 08:13:46 -0500 Subject: [PATCH 3/6] Update Scalafmt --- .scalafmt.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index 3abbf3a70b..5e1fa818c6 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version=2.5.3 +version=2.6.0 align.openParenCallSite = true align.openParenDefnSite = true maxColumn = 120 @@ -8,3 +8,4 @@ danglingParentheses = true rewrite.rules = [AvoidInfix, SortImports, RedundantParens, SortModifiers] docstrings = JavaDoc newlines.afterCurlyLambda = preserve +docstrings.style = Asterisk From 37d7e0f19615bdeee96b9fd10f4467fe448a0d30 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Wed, 17 Jun 2020 08:14:08 -0500 Subject: [PATCH 4/6] Format --- .../cats/compat/FoldableCompat.scala | 5 +-- .../cats/compat/FoldableCompat.scala | 5 +-- .../cats/data/NonEmptyLazyList.scala | 13 +++--- .../scala-2.13+/cats/instances/arraySeq.scala | 14 +++---- .../main/scala/cats/ApplicativeError.scala | 2 +- core/src/main/scala/cats/Apply.scala | 16 ++++--- core/src/main/scala/cats/Bifoldable.scala | 9 ++-- core/src/main/scala/cats/Bifunctor.scala | 3 +- core/src/main/scala/cats/Bitraverse.scala | 3 +- core/src/main/scala/cats/Foldable.scala | 10 ++--- core/src/main/scala/cats/Functor.scala | 1 - core/src/main/scala/cats/Reducible.scala | 2 +- core/src/main/scala/cats/Show.scala | 6 ++- core/src/main/scala/cats/TraverseFilter.scala | 3 +- core/src/main/scala/cats/data/AndThen.scala | 3 +- core/src/main/scala/cats/data/Binested.scala | 3 +- core/src/main/scala/cats/data/Chain.scala | 15 ++++--- core/src/main/scala/cats/data/ContT.scala | 6 ++- core/src/main/scala/cats/data/EitherK.scala | 3 +- core/src/main/scala/cats/data/EitherT.scala | 31 +++++++++----- core/src/main/scala/cats/data/Func.scala | 6 ++- .../main/scala/cats/data/IndexedStateT.scala | 1 - core/src/main/scala/cats/data/Ior.scala | 3 +- core/src/main/scala/cats/data/IorT.scala | 5 ++- core/src/main/scala/cats/data/Kleisli.scala | 8 ++-- core/src/main/scala/cats/data/Nested.scala | 3 +- .../main/scala/cats/data/NonEmptyChain.scala | 3 +- .../main/scala/cats/data/NonEmptyList.scala | 13 +++--- .../scala/cats/data/NonEmptyMapImpl.scala | 2 +- .../main/scala/cats/data/NonEmptyVector.scala | 18 ++++---- core/src/main/scala/cats/data/OptionT.scala | 11 ++--- core/src/main/scala/cats/data/Validated.scala | 5 --- core/src/main/scala/cats/instances/eq.scala | 3 +- .../src/main/scala/cats/instances/equiv.scala | 3 +- .../src/main/scala/cats/instances/order.scala | 3 +- .../scala/cats/instances/partialOrder.scala | 3 +- .../cats/instances/partialOrdering.scala | 3 +- core/src/main/scala/cats/package.scala | 6 ++- core/src/main/scala/cats/syntax/apply.scala | 6 ++- core/src/main/scala/cats/syntax/either.scala | 24 +++++++---- core/src/main/scala/cats/syntax/eq.scala | 3 +- core/src/main/scala/cats/syntax/flatMap.scala | 2 +- .../src/main/scala/cats/syntax/foldable.scala | 10 ++--- core/src/main/scala/cats/syntax/list.scala | 6 ++- .../main/scala/cats/syntax/reducible.scala | 2 +- .../scala/cats/syntax/traverseFilter.scala | 2 +- free/src/main/scala/cats/free/Cofree.scala | 42 ++++++++++++------- .../cats/free/ContravariantCoyoneda.scala | 33 ++++++++++----- free/src/main/scala/cats/free/Coyoneda.scala | 33 ++++++++++----- free/src/main/scala/cats/free/Free.scala | 25 ++++++----- .../scala/cats/free/FreeApplicative.scala | 12 ++++-- .../cats/free/FreeInvariantMonoidal.scala | 15 ++++--- free/src/main/scala/cats/free/FreeT.scala | 21 ++++++---- free/src/main/scala/cats/free/package.scala | 3 +- .../main/scala/cats/kernel/laws/IsEq.scala | 3 +- .../cats/kernel/compat/HashCompat.scala | 3 +- .../main/scala/cats/kernel/Comparison.scala | 3 +- kernel/src/main/scala/cats/kernel/Hash.scala | 3 +- .../cats/laws/CommutativeArrowLaws.scala | 3 +- .../main/scala/cats/laws/FoldableLaws.scala | 7 ++-- .../src/main/scala/cats/laws/StrongLaws.scala | 24 +++++++---- .../main/scala/cats/laws/discipline/Eq.scala | 6 ++- project/Boilerplate.scala | 3 +- .../main/scala/cats/tests/ListWrapper.scala | 6 ++- .../BinCodecInvariantMonoidalSuite.scala | 9 ++-- 65 files changed, 342 insertions(+), 219 deletions(-) diff --git a/core/src/main/scala-2.12/cats/compat/FoldableCompat.scala b/core/src/main/scala-2.12/cats/compat/FoldableCompat.scala index 5775d527dc..88d162bd02 100644 --- a/core/src/main/scala-2.12/cats/compat/FoldableCompat.scala +++ b/core/src/main/scala-2.12/cats/compat/FoldableCompat.scala @@ -5,7 +5,6 @@ private[cats] object FoldableCompat { def toIterable[F[_], A](fa: F[A])(F: Foldable[F]): Iterable[A] = F.foldRight[A, Stream[A]](fa, Eval.now(Stream.empty)) { (a, eb) => - eb.map(Stream.cons(a, _)) - } - .value + eb.map(Stream.cons(a, _)) + }.value } diff --git a/core/src/main/scala-2.13+/cats/compat/FoldableCompat.scala b/core/src/main/scala-2.13+/cats/compat/FoldableCompat.scala index 07c8abdadd..29bf40e7c4 100644 --- a/core/src/main/scala-2.13+/cats/compat/FoldableCompat.scala +++ b/core/src/main/scala-2.13+/cats/compat/FoldableCompat.scala @@ -5,7 +5,6 @@ private[cats] object FoldableCompat { def toIterable[F[_], A](fa: F[A])(F: Foldable[F]): Iterable[A] = F.foldRight[A, LazyList[A]](fa, Eval.now(LazyList.empty)) { (a, eb) => - eb.map(LazyList.cons(a, _)) - } - .value + eb.map(LazyList.cons(a, _)) + }.value } diff --git a/core/src/main/scala-2.13+/cats/data/NonEmptyLazyList.scala b/core/src/main/scala-2.13+/cats/data/NonEmptyLazyList.scala index 606b1311cd..9e1c0f1942 100644 --- a/core/src/main/scala-2.13+/cats/data/NonEmptyLazyList.scala +++ b/core/src/main/scala-2.13+/cats/data/NonEmptyLazyList.scala @@ -418,7 +418,7 @@ class NonEmptyLazyListOps[A](private val value: NonEmptyLazyList[A]) /** * Creates new `NonEmptyMap`, similarly to List#toMap from scala standard library. - *{{{ + * {{{ * scala> import cats.data.{NonEmptyLazyList, NonEmptyMap} * scala> import cats.implicits._ * scala> val nel = NonEmptyLazyList.fromLazyListPrepend((0, "a"), LazyList((1, "b"),(0, "c"), (2, "d"))) @@ -426,28 +426,27 @@ class NonEmptyLazyListOps[A](private val value: NonEmptyLazyList[A]) * scala> val result = nel.toNem * scala> result === expectedResult * res0: Boolean = true - *}}} - * + * }}} */ final def toNem[T, U](implicit ev: A <:< (T, U), order: Order[T]): NonEmptyMap[T, U] = NonEmptyMap.fromMapUnsafe(SortedMap(toLazyList.map(ev): _*)(order.toOrdering)) /** * Creates new `NonEmptySet`, similarly to List#toSet from scala standard library. - *{{{ + * {{{ * scala> import cats.data._ * scala> import cats.instances.int._ * scala> val nel = NonEmptyLazyList.fromLazyListPrepend(1, LazyList(2,2,3,4)) * scala> nel.toNes * res0: cats.data.NonEmptySet[Int] = TreeSet(1, 2, 3, 4) - *}}} + * }}} */ final def toNes[B >: A](implicit order: Order[B]): NonEmptySet[B] = NonEmptySet.of(head, tail: _*) /** * Creates new `NonEmptyVector`, similarly to List#toVector from scala standard library. - *{{{ + * {{{ * scala> import cats.data._ * scala> import cats.instances.int._ * scala> val nel = NonEmptyLazyList.fromLazyListPrepend(1, LazyList(2,3,4)) @@ -455,7 +454,7 @@ class NonEmptyLazyListOps[A](private val value: NonEmptyLazyList[A]) * scala> val result = nel.toNev * scala> result === expectedResult * res0: Boolean = true - *}}} + * }}} */ final def toNev[B >: A]: NonEmptyVector[B] = NonEmptyVector.fromVectorUnsafe(toLazyList.toVector) diff --git a/core/src/main/scala-2.13+/cats/instances/arraySeq.scala b/core/src/main/scala-2.13+/cats/instances/arraySeq.scala index b188ff6ecb..d1bedcf30d 100644 --- a/core/src/main/scala-2.13+/cats/instances/arraySeq.scala +++ b/core/src/main/scala-2.13+/cats/instances/arraySeq.scala @@ -192,16 +192,14 @@ private[cats] object ArraySeqInstances { fa: ArraySeq[A] )(f: (A) => G[Option[B]])(implicit G: Applicative[G]): G[ArraySeq[B]] = fa.foldRight(Eval.now(G.pure(ArraySeq.untagged.empty[B]))) { - case (x, xse) => - G.map2Eval(f(x), xse)((i, o) => i.fold(o)(_ +: o)) - } - .value + case (x, xse) => + G.map2Eval(f(x), xse)((i, o) => i.fold(o)(_ +: o)) + }.value override def filterA[G[_], A](fa: ArraySeq[A])(f: (A) => G[Boolean])(implicit G: Applicative[G]): G[ArraySeq[A]] = fa.foldRight(Eval.now(G.pure(ArraySeq.untagged.empty[A]))) { - case (x, xse) => - G.map2Eval(f(x), xse)((b, vec) => if (b) x +: vec else vec) - } - .value + case (x, xse) => + G.map2Eval(f(x), xse)((b, vec) => if (b) x +: vec else vec) + }.value } } diff --git a/core/src/main/scala/cats/ApplicativeError.scala b/core/src/main/scala/cats/ApplicativeError.scala index d2fcd0695e..e2cabbdbff 100644 --- a/core/src/main/scala/cats/ApplicativeError.scala +++ b/core/src/main/scala/cats/ApplicativeError.scala @@ -185,7 +185,7 @@ trait ApplicativeError[F[_], E] extends Applicative[F] { * scala> val prog2: F[Int] = (Err("two")).raiseError[F, Int] * * scala> prog1.onError(action).value.run("").value - + * * res0: (String, Either[Err,Int]) = (one,Left(Err(one))) * * scala> prog2.onError(action).value.run("").value diff --git a/core/src/main/scala/cats/Apply.scala b/core/src/main/scala/cats/Apply.scala index 54dd613098..b2db9dce22 100644 --- a/core/src/main/scala/cats/Apply.scala +++ b/core/src/main/scala/cats/Apply.scala @@ -71,7 +71,6 @@ trait Apply[F[_]] extends Functor[F] with InvariantSemigroupal[F] with ApplyArit * scala> Apply[ErrOr].productR(invalidInt)(invalidBool) * res3: ErrOr[Boolean] = Invalid(Invalid int.Invalid boolean.) * }}} - * */ def productR[A, B](fa: F[A])(fb: F[B]): F[B] = ap(map(fa)(_ => (b: B) => b))(fb) @@ -113,24 +112,29 @@ trait Apply[F[_]] extends Functor[F] with InvariantSemigroupal[F] with ApplyArit override def product[A, B](fa: F[A], fb: F[B]): F[(A, B)] = ap(map(fa)(a => (b: B) => (a, b)))(fb) - /** Alias for [[ap]]. */ + /** + * Alias for [[ap]]. */ @inline final def <*>[A, B](ff: F[A => B])(fa: F[A]): F[B] = ap(ff)(fa) - /** Alias for [[productR]]. */ + /** + * Alias for [[productR]]. */ @inline final def *>[A, B](fa: F[A])(fb: F[B]): F[B] = productR(fa)(fb) - /** Alias for [[productL]]. */ + /** + * Alias for [[productL]]. */ @inline final def <*[A, B](fa: F[A])(fb: F[B]): F[A] = productL(fa)(fb) - /** Alias for [[productR]]. */ + /** + * Alias for [[productR]]. */ @deprecated("Use *> or productR instead.", "1.0.0-RC2") @noop @inline final private[cats] def followedBy[A, B](fa: F[A])(fb: F[B]): F[B] = productR(fa)(fb) - /** Alias for [[productL]]. */ + /** + * Alias for [[productL]]. */ @deprecated("Use <* or productL instead.", "1.0.0-RC2") @noop @inline final private[cats] def forEffect[A, B](fa: F[A])(fb: F[B]): F[A] = productL(fa)(fb) diff --git a/core/src/main/scala/cats/Bifoldable.scala b/core/src/main/scala/cats/Bifoldable.scala index 241d989a69..ad82b4480b 100644 --- a/core/src/main/scala/cats/Bifoldable.scala +++ b/core/src/main/scala/cats/Bifoldable.scala @@ -9,13 +9,16 @@ import scala.annotation.implicitNotFound @implicitNotFound("Could not find an instance of Bifoldable for ${F}") @typeclass trait Bifoldable[F[_, _]] extends Serializable { self => - /** Collapse the structure with a left-associative function */ + /** + * Collapse the structure with a left-associative function */ def bifoldLeft[A, B, C](fab: F[A, B], c: C)(f: (C, A) => C, g: (C, B) => C): C - /** Collapse the structure with a right-associative function */ + /** + * Collapse the structure with a right-associative function */ def bifoldRight[A, B, C](fab: F[A, B], c: Eval[C])(f: (A, Eval[C]) => Eval[C], g: (B, Eval[C]) => Eval[C]): Eval[C] - /** Collapse the structure by mapping each element to an element of a type that has a [[cats.Monoid]] */ + /** + * Collapse the structure by mapping each element to an element of a type that has a [[cats.Monoid]] */ def bifoldMap[A, B, C](fab: F[A, B])(f: A => C, g: B => C)(implicit C: Monoid[C]): C = bifoldLeft(fab, C.empty)( (c: C, a: A) => C.combine(c, f(a)), diff --git a/core/src/main/scala/cats/Bifunctor.scala b/core/src/main/scala/cats/Bifunctor.scala index d635938ad5..f3338ba7d2 100644 --- a/core/src/main/scala/cats/Bifunctor.scala +++ b/core/src/main/scala/cats/Bifunctor.scala @@ -36,7 +36,8 @@ import scala.annotation.implicitNotFound */ def leftMap[A, B, C](fab: F[A, B])(f: A => C): F[C, B] = bimap(fab)(f, identity) - /** The composition of two Bifunctors is itself a Bifunctor */ + /** + * The composition of two Bifunctors is itself a Bifunctor */ def compose[G[_, _]](implicit G0: Bifunctor[G]): Bifunctor[λ[(α, β) => F[G[α, β], G[α, β]]]] = new ComposedBifunctor[F, G] { val F = self diff --git a/core/src/main/scala/cats/Bitraverse.scala b/core/src/main/scala/cats/Bitraverse.scala index 05e45fd967..d8800424a5 100644 --- a/core/src/main/scala/cats/Bitraverse.scala +++ b/core/src/main/scala/cats/Bitraverse.scala @@ -54,7 +54,8 @@ import scala.annotation.implicitNotFound def bisequence[G[_]: Applicative, A, B](fab: F[G[A], G[B]]): G[F[A, B]] = bitraverse(fab)(identity, identity) - /** If F and G are both [[cats.Bitraverse]] then so is their composition F[G[_, _], G[_, _]] */ + /** + * If F and G are both [[cats.Bitraverse]] then so is their composition F[G[_, _], G[_, _]] */ def compose[G[_, _]](implicit ev: Bitraverse[G]): Bitraverse[λ[(α, β) => F[G[α, β], G[α, β]]]] = new ComposedBitraverse[F, G] { val F = self diff --git a/core/src/main/scala/cats/Foldable.scala b/core/src/main/scala/cats/Foldable.scala index 58ae4d7dc2..267c41503e 100644 --- a/core/src/main/scala/cats/Foldable.scala +++ b/core/src/main/scala/cats/Foldable.scala @@ -311,12 +311,12 @@ import scala.annotation.implicitNotFound /** * Tear down a subset of this structure using a `PartialFunction`. - *{{{ + * {{{ * scala> import cats.implicits._ * scala> val xs = List(1, 2, 3, 4) * scala> Foldable[List].collectFold(xs) { case n if n % 2 == 0 => n } * res0: Int = 6 - *}}} + * }}} */ @noop def collectFold[A, B](fa: F[A])(f: PartialFunction[A, B])(implicit B: Monoid[B]): B = @@ -324,13 +324,13 @@ import scala.annotation.implicitNotFound /** * Tear down a subset of this structure using a `A => Option[M]`. - *{{{ + * {{{ * scala> import cats.implicits._ * scala> val xs = List(1, 2, 3, 4) * scala> def f(n: Int): Option[Int] = if (n % 2 == 0) Some(n) else None * scala> Foldable[List].collectFoldSome(xs)(f) * res0: Int = 6 - *}}} + * }}} */ def collectFoldSome[A, B](fa: F[A])(f: A => Option[B])(implicit B: Monoid[B]): B = foldLeft(fa, B.empty)((acc, a) => @@ -424,7 +424,7 @@ import scala.annotation.implicitNotFound * scala> val a = x("foo") * a: String = "foo321" * }}} - * */ + */ @noop def foldMapK[G[_], A, B](fa: F[A])(f: A => G[B])(implicit G: MonoidK[G]): G[B] = foldRight(fa, Eval.now(G.empty[B])) { (a, evalGb) => diff --git a/core/src/main/scala/cats/Functor.scala b/core/src/main/scala/cats/Functor.scala index 964d89f53c..1d9dbd49e2 100644 --- a/core/src/main/scala/cats/Functor.scala +++ b/core/src/main/scala/cats/Functor.scala @@ -172,7 +172,6 @@ import scala.annotation.implicitNotFound * scala> Functor[List].unzip(List((1,2), (3, 4))) * res0: (List[Int], List[Int]) = (List(1, 3),List(2, 4)) * }}} - * */ @noop def unzip[A, B](fab: F[(A, B)]): (F[A], F[B]) = (map(fab)(_._1), map(fab)(_._2)) diff --git a/core/src/main/scala/cats/Reducible.scala b/core/src/main/scala/cats/Reducible.scala index 5d9955e24d..0e87b61ece 100644 --- a/core/src/main/scala/cats/Reducible.scala +++ b/core/src/main/scala/cats/Reducible.scala @@ -67,7 +67,7 @@ import scala.annotation.implicitNotFound * scala> val a = x("foo") * a: String = "foo321" * }}} - * */ + */ @noop def reduceMapK[G[_], A, B](fa: F[A])(f: A => G[B])(implicit G: SemigroupK[G]): G[B] = reduceLeftTo(fa)(f)((b, a) => G.combineK(b, f(a))) diff --git a/core/src/main/scala/cats/Show.scala b/core/src/main/scala/cats/Show.scala index 4dff7c7644..70d8133289 100644 --- a/core/src/main/scala/cats/Show.scala +++ b/core/src/main/scala/cats/Show.scala @@ -39,13 +39,15 @@ object Show extends ScalaVersionSpecificShowInstances with ShowInstances { } } - /** creates an instance of [[Show]] using the provided function */ + /** + * creates an instance of [[Show]] using the provided function */ def show[A](f: A => String): Show[A] = new Show[A] { def show(a: A): String = f(a) } - /** creates an instance of [[Show]] using object toString */ + /** + * creates an instance of [[Show]] using object toString */ def fromToString[A]: Show[A] = new Show[A] { def show(a: A): String = a.toString diff --git a/core/src/main/scala/cats/TraverseFilter.scala b/core/src/main/scala/cats/TraverseFilter.scala index 05f5b48f34..da22769c56 100644 --- a/core/src/main/scala/cats/TraverseFilter.scala +++ b/core/src/main/scala/cats/TraverseFilter.scala @@ -43,13 +43,12 @@ trait TraverseFilter[F[_]] extends FunctorFilter[F] { * scala> val b: Either[String, List[Int]] = TraverseFilter[List].sequenceFilter(a) * b: Either[String, List[Int]] = Right(List(1, 5, 3)) * }}} - * */ + */ @noop def sequenceFilter[G[_], A](fgoa: F[G[Option[A]]])(implicit G: Applicative[G]): G[F[A]] = traverseFilter(fgoa)(identity) /** - * * Filter values inside a `G` context. * * This is a generalized version of Haskell's [[http://hackage.haskell.org/package/base-4.9.0.0/docs/Control-Monad.html#v:filterM filterM]]. diff --git a/core/src/main/scala/cats/data/AndThen.scala b/core/src/main/scala/cats/data/AndThen.scala index e50fc1e1a8..42f96a1ee1 100644 --- a/core/src/main/scala/cats/data/AndThen.scala +++ b/core/src/main/scala/cats/data/AndThen.scala @@ -138,7 +138,8 @@ sealed abstract class AndThen[-T, +R] extends (T => R) with Product with Seriali object AndThen extends AndThenInstances0 { - /** Builds an [[AndThen]] reference by wrapping a plain function. */ + /** + * Builds an [[AndThen]] reference by wrapping a plain function. */ def apply[A, B](f: A => B): AndThen[A, B] = f match { case ref: AndThen[A, B] @unchecked => ref diff --git a/core/src/main/scala/cats/data/Binested.scala b/core/src/main/scala/cats/data/Binested.scala index 00bea89b18..22a822c44e 100644 --- a/core/src/main/scala/cats/data/Binested.scala +++ b/core/src/main/scala/cats/data/Binested.scala @@ -3,7 +3,8 @@ package data import cats.arrow._ -/** Compose a two-slot type constructor `F[_, _]` with two single-slot type constructors +/** + * Compose a two-slot type constructor `F[_, _]` with two single-slot type constructors * `G[_]` and `H[_]`, resulting in a two-slot type constructor with respect to the inner types. * For example, `List` and `Option` both have `Functor` instances, and `Either` has a * `Bifunctor` instance. Therefore, `Binested[Either, List, Option, *, *]` has a `Bifunctor` diff --git a/core/src/main/scala/cats/data/Chain.scala b/core/src/main/scala/cats/data/Chain.scala index ceda644375..ac70bce537 100644 --- a/core/src/main/scala/cats/data/Chain.scala +++ b/core/src/main/scala/cats/data/Chain.scala @@ -595,27 +595,32 @@ object Chain extends ChainInstances { c.initLast } - /** Empty Chain. */ + /** + * Empty Chain. */ val nil: Chain[Nothing] = Empty def empty[A]: Chain[A] = nil - /** Creates a Chain of 1 element. */ + /** + * Creates a Chain of 1 element. */ def one[A](a: A): Chain[A] = Singleton(a) - /** Concatenates two Chains. */ + /** + * Concatenates two Chains. */ def concat[A](c: Chain[A], c2: Chain[A]): Chain[A] = if (c.isEmpty) c2 else if (c2.isEmpty) c else Append(c, c2) - /** Creates a Chain from the specified sequence. */ + /** + * Creates a Chain from the specified sequence. */ def fromSeq[A](s: Seq[A]): Chain[A] = if (s.isEmpty) nil else if (s.lengthCompare(1) == 0) one(s.head) else Wrap(s) - /** Creates a Chain from the specified elements. */ + /** + * Creates a Chain from the specified elements. */ def apply[A](as: A*): Chain[A] = fromSeq(as) diff --git a/core/src/main/scala/cats/data/ContT.scala b/core/src/main/scala/cats/data/ContT.scala index c0180a686e..d4e515265a 100644 --- a/core/src/main/scala/cats/data/ContT.scala +++ b/core/src/main/scala/cats/data/ContT.scala @@ -65,7 +65,8 @@ object ContT { lazy val runAndThen: AndThen[B => M[A], M[A]] = loop(next).runAndThen } - /** Lift a pure value into `ContT` */ + /** + * Lift a pure value into `ContT` */ def pure[M[_], A, B](b: B): ContT[M, A, B] = apply { cb => cb(b) @@ -152,7 +153,8 @@ object ContT { def apply[M[_], A, B](fn: (B => M[A]) => M[A]): ContT[M, A, B] = FromFn(AndThen(fn)) - /** Similar to [[apply]] but evaluation of the argument is deferred. */ + /** + * Similar to [[apply]] but evaluation of the argument is deferred. */ def later[M[_], A, B](fn: => (B => M[A]) => M[A]): ContT[M, A, B] = DeferCont(() => FromFn(AndThen(fn))) diff --git a/core/src/main/scala/cats/data/EitherK.scala b/core/src/main/scala/cats/data/EitherK.scala index a02f65b40f..e5719bb2fb 100644 --- a/core/src/main/scala/cats/data/EitherK.scala +++ b/core/src/main/scala/cats/data/EitherK.scala @@ -4,7 +4,8 @@ package data import cats.Contravariant import cats.arrow.FunctionK -/** `F` on the left and `G` on the right of `scala.util.Either`. +/** + * `F` on the left and `G` on the right of `scala.util.Either`. * * @param run The underlying `scala.util.Either`. */ diff --git a/core/src/main/scala/cats/data/EitherT.scala b/core/src/main/scala/cats/data/EitherT.scala index 2ebd7035c6..3ed6cf26e0 100644 --- a/core/src/main/scala/cats/data/EitherT.scala +++ b/core/src/main/scala/cats/data/EitherT.scala @@ -13,7 +13,8 @@ import cats.syntax.EitherUtil */ final case class EitherT[F[_], A, B](value: F[Either[A, B]]) { - /** Transform this `EitherT[F, A, B]` into a `F[C]`. + /** + * Transform this `EitherT[F, A, B]` into a `F[C]`. * * Example: * {{{ @@ -27,7 +28,8 @@ final case class EitherT[F[_], A, B](value: F[Either[A, B]]) { */ def fold[C](fa: A => C, fb: B => C)(implicit F: Functor[F]): F[C] = F.map(value)(_.fold(fa, fb)) - /** Transform this `EitherT[F, A, B]` into a `F[C]`. + /** + * Transform this `EitherT[F, A, B]` into a `F[C]`. * * Example: * {{{ @@ -425,7 +427,8 @@ final case class EitherT[F[_], A, B](value: F[Either[A, B]]) { case r @ Right(_) => F.pure(EitherUtil.leftCast(r)) }) - /** Combine `leftSemiflatMap` and `semiflatMap` together. + /** + * Combine `leftSemiflatMap` and `semiflatMap` together. * * Example: * {{{ @@ -545,7 +548,8 @@ final case class EitherT[F[_], A, B](value: F[Either[A, B]]) { case Left(a) => Validated.invalidNec(a) } - /** Run this value as a `[[Validated]]` against the function and convert it back to an `[[EitherT]]`. + /** + * Run this value as a `[[Validated]]` against the function and convert it back to an `[[EitherT]]`. * * The [[Applicative]] instance for `EitherT` "fails fast" - it is often useful to "momentarily" have * it accumulate errors instead, which is what the `[[Validated]]` data type gives us. @@ -585,7 +589,6 @@ final case class EitherT[F[_], A, B](value: F[Either[A, B]]) { * scala> EitherT((ff.toNested).ap(fa.toNested).value) * res1: EitherT[List,String,String] = EitherT(List(Right(1), Right(2), Left(error), Left(error))) * }}} - * */ def toNested: Nested[F, Either[A, *], B] = Nested[F, Either[A, *], B](value) @@ -769,7 +772,8 @@ object EitherT extends EitherTInstances { @deprecated("Use EitherT.liftF.", "1.0.0-RC1") final def liftT[F[_], A, B](fb: F[B])(implicit F: Functor[F]): EitherT[F, A, B] = right(fb) - /** Transforms an `Either` into an `EitherT`, lifted into the specified `Applicative`. + /** + * Transforms an `Either` into an `EitherT`, lifted into the specified `Applicative`. * * Note: The return type is a FromEitherPartiallyApplied[F], which has an apply method * on it, allowing you to call fromEither like this: @@ -792,7 +796,8 @@ object EitherT extends EitherTInstances { EitherT(F.pure(either)) } - /** Transforms an `Option` into an `EitherT`, lifted into the specified `Applicative` and using + /** + * Transforms an `Option` into an `EitherT`, lifted into the specified `Applicative` and using * the second argument if the `Option` is a `None`. * {{{ * scala> import cats.implicits._ @@ -820,7 +825,8 @@ object EitherT extends EitherTInstances { ) } - /** Transforms an `F[Option]` into an `EitherT`, using the second argument if the `Option` is a `None`. + /** + * Transforms an `F[Option]` into an `EitherT`, using the second argument if the `Option` is a `None`. * {{{ * scala> import cats.implicits._ * scala> val o: Option[Int] = None @@ -838,7 +844,8 @@ object EitherT extends EitherTInstances { } ) - /** Similar to `fromOptionF` but the left is carried from monadic `F[_]` context when the option is `None` */ + /** + * Similar to `fromOptionF` but the left is carried from monadic `F[_]` context when the option is `None` */ final def fromOptionM[F[_], E, A](fopt: F[Option[A]], ifNone: => F[E])(implicit F: Monad[F]): EitherT[F, E, A] = EitherT( F.flatMap(fopt) { @@ -847,7 +854,8 @@ object EitherT extends EitherTInstances { } ) - /** If the condition is satisfied, return the given `A` in `Right` + /** + * If the condition is satisfied, return the given `A` in `Right` * lifted into the specified `Applicative`, otherwise, return the * given `E` in `Left` lifted into the specified `Applicative`. * @@ -998,7 +1006,8 @@ abstract private[data] class EitherTInstances1 extends EitherTInstances2 { abstract private[data] class EitherTInstances2 extends EitherTInstances3 { - /** Monad error instance for recovering errors in F instead of + /** + * Monad error instance for recovering errors in F instead of * the underlying Either. * * {{{ diff --git a/core/src/main/scala/cats/data/Func.scala b/core/src/main/scala/cats/data/Func.scala index 6782622637..34b27d4ed0 100644 --- a/core/src/main/scala/cats/data/Func.scala +++ b/core/src/main/scala/cats/data/Func.scala @@ -22,13 +22,15 @@ sealed abstract class Func[F[_], A, B] { self => object Func extends FuncInstances { - /** function `A => F[B]`. */ + /** + * function `A => F[B]`. */ def func[F[_], A, B](run0: A => F[B]): Func[F, A, B] = new Func[F, A, B] { def run: A => F[B] = run0 } - /** applicative function. */ + /** + * applicative function. */ def appFunc[F[_], A, B](run0: A => F[B])(implicit FF: Applicative[F]): AppFunc[F, A, B] = new AppFunc[F, A, B] { def F: Applicative[F] = FF diff --git a/core/src/main/scala/cats/data/IndexedStateT.scala b/core/src/main/scala/cats/data/IndexedStateT.scala index 758ff042dd..c0cae4b8b6 100644 --- a/core/src/main/scala/cats/data/IndexedStateT.scala +++ b/core/src/main/scala/cats/data/IndexedStateT.scala @@ -4,7 +4,6 @@ package data import cats.arrow.{Profunctor, Strong} /** - * * `IndexedStateT[F, SA, SB, A]` is a stateful computation in a context `F` yielding * a value of type `A`. The state transitions from a value of type `SA` to a value * of type `SB`. diff --git a/core/src/main/scala/cats/data/Ior.scala b/core/src/main/scala/cats/data/Ior.scala index 5230df2081..a196ac052e 100644 --- a/core/src/main/scala/cats/data/Ior.scala +++ b/core/src/main/scala/cats/data/Ior.scala @@ -7,7 +7,8 @@ import cats.data.Validated.{Invalid, Valid} import scala.annotation.tailrec -/** Represents a right-biased disjunction that is either an `A`, or a `B`, or both an `A` and a `B`. +/** + * Represents a right-biased disjunction that is either an `A`, or a `B`, or both an `A` and a `B`. * * An instance of `A [[Ior]] B` is one of: * - `[[Ior.Left Left]][A]` diff --git a/core/src/main/scala/cats/data/IorT.scala b/core/src/main/scala/cats/data/IorT.scala index 6d885e2ac1..4a6686b4e8 100644 --- a/core/src/main/scala/cats/data/IorT.scala +++ b/core/src/main/scala/cats/data/IorT.scala @@ -157,7 +157,7 @@ object IorT extends IorTInstances { * scala> import cats.implicits._ * scala> IorT.leftT[Option, Int]("err") * res0: cats.data.IorT[Option,String,Int] = IorT(Some(Left(err))) - + * * }}} */ final def leftT[F[_], B]: LeftTPartiallyApplied[F, B] = new LeftTPartiallyApplied[F, B] @@ -359,7 +359,8 @@ object IorT extends IorTInstances { final def fromOptionF[F[_], E, A](foption: F[Option[A]], ifNone: => E)(implicit F: Functor[F]): IorT[F, E, A] = IorT(F.map(foption)(_.fold[Ior[E, A]](Ior.left(ifNone))(Ior.right))) - /** Similar to `fromOptionF` but the left is carried from monadic `F[_]` context when the option is `None` */ + /** + * Similar to `fromOptionF` but the left is carried from monadic `F[_]` context when the option is `None` */ final def fromOptionM[F[_], E, A](foption: F[Option[A]], ifNone: => F[E])(implicit F: Monad[F]): IorT[F, E, A] = IorT( F.flatMap(foption) { diff --git a/core/src/main/scala/cats/data/Kleisli.scala b/core/src/main/scala/cats/data/Kleisli.scala index c1ace5da3e..395fccfcc9 100644 --- a/core/src/main/scala/cats/data/Kleisli.scala +++ b/core/src/main/scala/cats/data/Kleisli.scala @@ -112,11 +112,13 @@ final case class Kleisli[F[_], -A, B](run: A => F[B]) { self => def second[C](implicit F: Functor[F]): Kleisli[F, (C, A), (C, B)] = Kleisli { case (c, a) => F.map(run(a))(c -> _) } - /** Discard computed B and yield the input value. */ + /** + * Discard computed B and yield the input value. */ def tap[AA <: A](implicit F: Functor[F]): Kleisli[F, AA, AA] = Kleisli(a => F.as(run(a), a)) - /** Yield computed B combined with input value. */ + /** + * Yield computed B combined with input value. */ def tapWith[C, AA <: A](f: (AA, B) => C)(implicit F: Functor[F]): Kleisli[F, AA, C] = Kleisli(a => F.map(run(a))(b => f(a, b))) @@ -275,7 +277,7 @@ sealed private[data] trait KleisliFunctionsBinCompat { * scala> k2.run("foo") * res1: Option[Char] = Some(f) * }}} - * */ + */ def liftFunctionK[F[_], G[_], A](f: F ~> G): Kleisli[F, A, *] ~> Kleisli[G, A, *] = new (Kleisli[F, A, *] ~> Kleisli[G, A, *]) { def apply[B](k: Kleisli[F, A, B]): Kleisli[G, A, B] = k.mapK(f) } } diff --git a/core/src/main/scala/cats/data/Nested.scala b/core/src/main/scala/cats/data/Nested.scala index 4116144942..df1cd98399 100644 --- a/core/src/main/scala/cats/data/Nested.scala +++ b/core/src/main/scala/cats/data/Nested.scala @@ -1,7 +1,8 @@ package cats package data -/** Similar to [[cats.data.Tuple2K]], but for nested composition. +/** + * Similar to [[cats.data.Tuple2K]], but for nested composition. * * For instance, since both `List` and `Option` have a `Functor`, then so does * `List[Option[_]]`. This is represented by this data type via the instantiation diff --git a/core/src/main/scala/cats/data/NonEmptyChain.scala b/core/src/main/scala/cats/data/NonEmptyChain.scala index d0f577fa71..9e0602303f 100644 --- a/core/src/main/scala/cats/data/NonEmptyChain.scala +++ b/core/src/main/scala/cats/data/NonEmptyChain.scala @@ -391,7 +391,8 @@ class NonEmptyChainOps[A](private val value: NonEmptyChain[A]) final def reverseIterator: Iterator[A] = toChain.reverseIterator - /** Reverses this `NonEmptyChain` */ + /** + * Reverses this `NonEmptyChain` */ final def reverse: NonEmptyChain[A] = create(toChain.reverse) diff --git a/core/src/main/scala/cats/data/NonEmptyList.scala b/core/src/main/scala/cats/data/NonEmptyList.scala index be0e1e53b2..f359a3d7ca 100644 --- a/core/src/main/scala/cats/data/NonEmptyList.scala +++ b/core/src/main/scala/cats/data/NonEmptyList.scala @@ -413,7 +413,7 @@ final case class NonEmptyList[+A](head: A, tail: List[A]) extends NonEmptyCollec /** * Creates new `NonEmptyMap`, similarly to List#toMap from scala standard library. - *{{{ + * {{{ * scala> import cats.data.{NonEmptyList, NonEmptyMap} * scala> import cats.implicits._ * scala> val nel = NonEmptyList((0, "a"), List((1, "b"),(0, "c"), (2, "d"))) @@ -421,28 +421,27 @@ final case class NonEmptyList[+A](head: A, tail: List[A]) extends NonEmptyCollec * scala> val result = nel.toNem * scala> result === expectedResult * res0: Boolean = true - *}}} - * + * }}} */ def toNem[T, U](implicit ev: A <:< (T, U), order: Order[T]): NonEmptyMap[T, U] = NonEmptyMap.fromMapUnsafe(SortedMap(toList.map(ev): _*)(order.toOrdering)) /** * Creates new `NonEmptySet`, similarly to List#toSet from scala standard library. - *{{{ + * {{{ * scala> import cats.data._ * scala> import cats.instances.int._ * scala> val nel = NonEmptyList(1, List(2,2,3,4)) * scala> nel.toNes * res0: cats.data.NonEmptySet[Int] = TreeSet(1, 2, 3, 4) - *}}} + * }}} */ def toNes[B >: A](implicit order: Order[B]): NonEmptySet[B] = NonEmptySet.of(head, tail: _*) /** * Creates new `NonEmptyVector`, similarly to List#toVector from scala standard library. - *{{{ + * {{{ * scala> import cats.data._ * scala> import cats.instances.int._ * scala> val nel = NonEmptyList(1, List(2,3,4)) @@ -450,7 +449,7 @@ final case class NonEmptyList[+A](head: A, tail: List[A]) extends NonEmptyCollec * scala> val result = nel.toNev * scala> result === expectedResult * res0: Boolean = true - *}}} + * }}} */ def toNev[B >: A]: NonEmptyVector[B] = NonEmptyVector.fromVectorUnsafe(toList.toVector) diff --git a/core/src/main/scala/cats/data/NonEmptyMapImpl.scala b/core/src/main/scala/cats/data/NonEmptyMapImpl.scala index 4151acbe84..7fd31b2f1c 100644 --- a/core/src/main/scala/cats/data/NonEmptyMapImpl.scala +++ b/core/src/main/scala/cats/data/NonEmptyMapImpl.scala @@ -69,7 +69,7 @@ sealed class NonEmptyMapOps[K, A](val value: NonEmptyMap[K, A]) { /** * Adds a key-value pair to this map, returning a new `NonEmptyMap`. - * */ + */ def add(ka: (K, A)): NonEmptyMap[K, A] = NonEmptyMapImpl.create(toSortedMap + ka) /** diff --git a/core/src/main/scala/cats/data/NonEmptyVector.scala b/core/src/main/scala/cats/data/NonEmptyVector.scala index 7d29f0448c..7a992484de 100644 --- a/core/src/main/scala/cats/data/NonEmptyVector.scala +++ b/core/src/main/scala/cats/data/NonEmptyVector.scala @@ -19,14 +19,17 @@ final class NonEmptyVector[+A] private (val toVector: Vector[A]) extends AnyVal with NonEmptyCollection[A, Vector, NonEmptyVector] { - /** Gets the element at the index, if it exists */ + /** + * Gets the element at the index, if it exists */ def get(i: Int): Option[A] = toVector.lift(i) - /** Gets the element at the index, or throws an exception if none exists */ + /** + * Gets the element at the index, or throws an exception if none exists */ def getUnsafe(i: Int): A = toVector(i) - /** Updates the element at the index, if it exists */ + /** + * Updates the element at the index, if it exists */ def updated[AA >: A](i: Int, a: AA): Option[NonEmptyVector[AA]] = if (toVector.isDefinedAt(i)) Some(new NonEmptyVector(toVector.updated(i, a))) else None @@ -296,7 +299,7 @@ final class NonEmptyVector[+A] private (val toVector: Vector[A]) /** * Creates new `NonEmptyMap`, similarly to List#toMap from scala standard library. - *{{{ + * {{{ * scala> import cats.data.{NonEmptyMap, NonEmptyVector} * scala> import cats.implicits._ * scala> val nev = NonEmptyVector((0, "a"), Vector((1, "b"),(0, "c"), (2, "d"))) @@ -304,21 +307,20 @@ final class NonEmptyVector[+A] private (val toVector: Vector[A]) * scala> val result = nev.toNem * scala> result === expectedResult * res0: Boolean = true - *}}} - * + * }}} */ final def toNem[T, U](implicit ev: A <:< (T, U), order: Order[T]): NonEmptyMap[T, U] = NonEmptyMap.fromMapUnsafe(SortedMap(toVector.map(ev): _*)(order.toOrdering)) /** * Creates new `NonEmptySet`, similarly to List#toSet from scala standard library. - *{{{ + * {{{ * scala> import cats.data._ * scala> import cats.instances.int._ * scala> val nev = NonEmptyVector(1, Vector(2,2,3,4)) * scala> nev.toNes * res0: cats.data.NonEmptySet[Int] = TreeSet(1, 2, 3, 4) - *}}} + * }}} */ final def toNes[B >: A](implicit order: Order[B]): NonEmptySet[B] = NonEmptySet.of(head, tail: _*) diff --git a/core/src/main/scala/cats/data/OptionT.scala b/core/src/main/scala/cats/data/OptionT.scala index 7eb61a0482..eb60501110 100644 --- a/core/src/main/scala/cats/data/OptionT.scala +++ b/core/src/main/scala/cats/data/OptionT.scala @@ -14,7 +14,8 @@ final case class OptionT[F[_], A](value: F[Option[A]]) { def fold[B](default: => B)(f: A => B)(implicit F: Functor[F]): F[B] = F.map(value)(_.fold(default)(f)) - /** Transform this `OptionT[F, A]` into a `F[C]`. + /** + * Transform this `OptionT[F, A]` into a `F[C]`. * * Example: * {{{ @@ -197,25 +198,25 @@ object OptionT extends OptionTInstances { OptionT(F.pure(Some(value))) } - /** Creates a `OptionT[A]` from an `A` + /** + * Creates a `OptionT[A]` from an `A` * * {{{ * scala> import cats.implicits._ * scala> OptionT.pure[List](2) * res0: OptionT[List, Int] = OptionT(List(Some(2))) * }}} - * */ def pure[F[_]]: PurePartiallyApplied[F] = new PurePartiallyApplied[F] - /** An alias for pure + /** + * An alias for pure * * {{{ * scala> import cats.implicits._ * scala> OptionT.some[List](2) * res0: OptionT[List, Int] = OptionT(List(Some(2))) * }}} - * */ def some[F[_]]: PurePartiallyApplied[F] = pure diff --git a/core/src/main/scala/cats/data/Validated.scala b/core/src/main/scala/cats/data/Validated.scala index c6d287769a..51100aae05 100644 --- a/core/src/main/scala/cats/data/Validated.scala +++ b/core/src/main/scala/cats/data/Validated.scala @@ -237,7 +237,6 @@ sealed abstract class Validated[+E, +A] extends Product with Serializable { * scala> v2.toEither * res1: Either[String, Int] = Right(123) * }}} - * */ def toEither: Either[E, A] = this match { @@ -496,7 +495,6 @@ sealed abstract class Validated[+E, +A] extends Product with Serializable { * scala> v2.ap(f) * res1: Validated[String, Option[Int]] = Valid(Some(123)) * }}} - * */ def ap[EE >: E, B](f: Validated[EE, A => B])(implicit EE: Semigroup[EE]): Validated[EE, B] = (this, f) match { @@ -653,7 +651,6 @@ sealed abstract class Validated[+E, +A] extends Product with Serializable { * scala> v2.foldRight(Eval.now(456))((i,e) => e.map(_ + i)).value * res1: Int = 579 * }}} - * */ def foldRight[B](lb: Eval[B])(f: (A, Eval[B]) => Eval[B]): Eval[B] = this match { @@ -750,7 +747,6 @@ sealed abstract class Validated[+E, +A] extends Product with Serializable { * scala> v2.swap * res1: Validated[Int, String] = Invalid(123) * }}} - * */ def swap: Validated[A, E] = this match { @@ -772,7 +768,6 @@ sealed abstract class Validated[+E, +A] extends Product with Serializable { * scala> v2.merge * res1: Seq[String] = List(Ok) * }}} - * */ def merge[EE >: E](implicit ev: A <:< EE): EE = this match { diff --git a/core/src/main/scala/cats/instances/eq.scala b/core/src/main/scala/cats/instances/eq.scala index 5140bca36f..69c3429721 100644 --- a/core/src/main/scala/cats/instances/eq.scala +++ b/core/src/main/scala/cats/instances/eq.scala @@ -11,7 +11,8 @@ trait EqInstances extends kernel.instances.EqInstances { */ def unit: Eq[Unit] = Eq.allEqual - /** Derive an `Eq` for `B` given an `Eq[A]` and a function `B => A`. + /** + * Derive an `Eq` for `B` given an `Eq[A]` and a function `B => A`. * * Note: resulting instances are law-abiding only when the functions used are injective (represent a one-to-one mapping) */ diff --git a/core/src/main/scala/cats/instances/equiv.scala b/core/src/main/scala/cats/instances/equiv.scala index 12e3bcc671..6730aeb1cc 100644 --- a/core/src/main/scala/cats/instances/equiv.scala +++ b/core/src/main/scala/cats/instances/equiv.scala @@ -14,7 +14,8 @@ trait EquivInstances { def equiv(x: Unit, y: Unit): Boolean = true } - /** Derive an `Equiv` for `B` given an `Equiv[A]` and a function `B => A`. + /** + * Derive an `Equiv` for `B` given an `Equiv[A]` and a function `B => A`. * * Note: resulting instances are law-abiding only when the functions used are injective (represent a one-to-one mapping) */ diff --git a/core/src/main/scala/cats/instances/order.scala b/core/src/main/scala/cats/instances/order.scala index 873425952e..96b26eefba 100644 --- a/core/src/main/scala/cats/instances/order.scala +++ b/core/src/main/scala/cats/instances/order.scala @@ -13,7 +13,8 @@ trait OrderInstances extends kernel.instances.OrderInstances { */ def unit: Order[Unit] = Order[Unit] - /** Derive an `Order` for `B` given an `Order[A]` and a function `B => A`. + /** + * Derive an `Order` for `B` given an `Order[A]` and a function `B => A`. * * Note: resulting instances are law-abiding only when the functions used are injective (represent a one-to-one mapping) */ diff --git a/core/src/main/scala/cats/instances/partialOrder.scala b/core/src/main/scala/cats/instances/partialOrder.scala index a41919c48f..e9121dd182 100644 --- a/core/src/main/scala/cats/instances/partialOrder.scala +++ b/core/src/main/scala/cats/instances/partialOrder.scala @@ -6,7 +6,8 @@ trait PartialOrderInstances extends kernel.instances.PartialOrderInstances { implicit val catsContravariantMonoidalForPartialOrder: ContravariantMonoidal[PartialOrder] = new ContravariantMonoidal[PartialOrder] { - /** Derive a `PartialOrder` for `B` given a `PartialOrder[A]` and a function `B => A`. + /** + * Derive a `PartialOrder` for `B` given a `PartialOrder[A]` and a function `B => A`. * * Note: resulting instances are law-abiding only when the functions used are injective (represent a one-to-one mapping) */ diff --git a/core/src/main/scala/cats/instances/partialOrdering.scala b/core/src/main/scala/cats/instances/partialOrdering.scala index 9b1e599aaa..ce57853f32 100644 --- a/core/src/main/scala/cats/instances/partialOrdering.scala +++ b/core/src/main/scala/cats/instances/partialOrdering.scala @@ -5,7 +5,8 @@ trait PartialOrderingInstances { implicit val catsContravariantMonoidalForPartialOrdering: ContravariantMonoidal[PartialOrdering] = new ContravariantMonoidal[PartialOrdering] { - /** Derive a `PartialOrdering` for `B` given a `PartialOrdering[A]` and a function `B => A`. + /** + * Derive a `PartialOrdering` for `B` given a `PartialOrdering[A]` and a function `B => A`. * * Note: resulting instances are law-abiding only when the functions used are injective (represent a one-to-one mapping) */ diff --git a/core/src/main/scala/cats/package.scala b/core/src/main/scala/cats/package.scala index e90b835aaf..c5ae7bc9c5 100644 --- a/core/src/main/scala/cats/package.scala +++ b/core/src/main/scala/cats/package.scala @@ -38,10 +38,12 @@ package object cats { type ⊥ = Nothing type ⊤ = Any - /** [[cats.InjectK]][F, G] */ + /** + * [[cats.InjectK]][F, G] */ type :<:[F[_], G[_]] = InjectK[F, G] - /** [[cats.InjectK]][F, G] */ + /** + * [[cats.InjectK]][F, G] */ type :≺:[F[_], G[_]] = InjectK[F, G] /** diff --git a/core/src/main/scala/cats/syntax/apply.scala b/core/src/main/scala/cats/syntax/apply.scala index cab0e3d247..e9e985cb9b 100644 --- a/core/src/main/scala/cats/syntax/apply.scala +++ b/core/src/main/scala/cats/syntax/apply.scala @@ -54,12 +54,14 @@ final class IfApplyOps[F[_]](private val fcond: F[Boolean]) extends AnyVal { final class ApplyOps[F[_], A](private val fa: F[A]) extends AnyVal { - /** Alias for [[Apply.productR]]. */ + /** + * Alias for [[Apply.productR]]. */ @deprecated("Use *> or productR instead.", "1.0.0-RC2") @inline private[syntax] def followedBy[B](fb: F[B])(implicit F: Apply[F]): F[B] = F.productR(fa)(fb) - /** Alias for [[Apply.productL]]. */ + /** + * Alias for [[Apply.productL]]. */ @deprecated("Use <* or productL instead.", "1.0.0-RC2") @inline private[syntax] def forEffect[B](fb: F[B])(implicit F: Apply[F]): F[A] = F.productL(fa)(fb) diff --git a/core/src/main/scala/cats/syntax/either.scala b/core/src/main/scala/cats/syntax/either.scala index 91e95d9c4b..b1ecf9822c 100644 --- a/core/src/main/scala/cats/syntax/either.scala +++ b/core/src/main/scala/cats/syntax/either.scala @@ -129,7 +129,8 @@ final class EitherOps[A, B](private val eab: Either[A, B]) extends AnyVal { case Right(b) => Validated.valid(b) } - /** Returns a [[cats.data.ValidatedNel]] representation of this disjunction with the `Left` value + /** + * Returns a [[cats.data.ValidatedNel]] representation of this disjunction with the `Left` value * as a single element on the `Invalid` side of the [[cats.data.NonEmptyList]]. */ def toValidatedNel[AA >: A]: ValidatedNel[AA, B] = eab match { @@ -389,28 +390,33 @@ final class EitherObjectOps(private val either: Either.type) extends AnyVal { // case Some(a) => right(a) } - /** Cached value of `Right(())` to avoid allocations for a common case. */ + /** + * Cached value of `Right(())` to avoid allocations for a common case. */ def unit[A]: Either[A, Unit] = EitherUtil.unit } final class LeftOps[A, B](private val left: Left[A, B]) extends AnyVal { - /** Cast the right type parameter of the `Left`. */ + /** + * Cast the right type parameter of the `Left`. */ def rightCast[C]: Either[A, C] = left.asInstanceOf[Either[A, C]] } final class RightOps[A, B](private val right: Right[A, B]) extends AnyVal { - /** Cast the left type parameter of the `Right`. */ + /** + * Cast the left type parameter of the `Right`. */ def leftCast[C]: Either[C, B] = right.asInstanceOf[Either[C, B]] } final class EitherIdOps[A](private val obj: A) extends AnyVal { - /** Wrap a value in `Left`. */ + /** + * Wrap a value in `Left`. */ def asLeft[B]: Either[A, B] = Left(obj) - /** Wrap a value in `Right`. */ + /** + * Wrap a value in `Right`. */ def asRight[B]: Either[B, A] = Right(obj) /** @@ -476,7 +482,8 @@ final private[syntax] class EitherIdOpsBinCompat0[A](private val value: A) exten final private[syntax] class EitherOpsBinCompat0[A, B](private val value: Either[A, B]) extends AnyVal { - /** Returns a [[cats.data.ValidatedNec]] representation of this disjunction with the `Left` value + /** + * Returns a [[cats.data.ValidatedNec]] representation of this disjunction with the `Left` value * as a single element on the `Invalid` side of the [[cats.data.NonEmptyList]]. */ def toValidatedNec: ValidatedNec[A, B] = value match { @@ -485,7 +492,8 @@ final private[syntax] class EitherOpsBinCompat0[A, B](private val value: Either[ } } -/** Convenience methods to use `Either` syntax inside `Either` syntax definitions. */ +/** + * Convenience methods to use `Either` syntax inside `Either` syntax definitions. */ private[cats] object EitherUtil { def leftCast[A, B, C](right: Right[A, B]): Either[C, B] = right.asInstanceOf[Either[C, B]] diff --git a/core/src/main/scala/cats/syntax/eq.scala b/core/src/main/scala/cats/syntax/eq.scala index 66130d300e..114290ac44 100644 --- a/core/src/main/scala/cats/syntax/eq.scala +++ b/core/src/main/scala/cats/syntax/eq.scala @@ -3,7 +3,8 @@ package syntax trait EqSyntax { - /** not final so it can be disabled in favor of scalactic equality in tests */ + /** + * not final so it can be disabled in favor of scalactic equality in tests */ implicit def catsSyntaxEq[A: Eq](a: A): EqOps[A] = new EqOps[A](a) } diff --git a/core/src/main/scala/cats/syntax/flatMap.scala b/core/src/main/scala/cats/syntax/flatMap.scala index 5e59245ed7..93d1b94c58 100644 --- a/core/src/main/scala/cats/syntax/flatMap.scala +++ b/core/src/main/scala/cats/syntax/flatMap.scala @@ -109,7 +109,7 @@ final class FlatMapIdOps[A](private val a: A) extends AnyVal { * scala> a.tailRecM[Option,String](i => if (i == 20) Some(Right("done")) else Some(Left(i+1))) * res0: Option[String] = Some(done) * - *}}} + * }}} */ def tailRecM[F[_], B](f: A => F[Either[A, B]])(implicit F: FlatMap[F]): F[B] = F.tailRecM(a)(f) diff --git a/core/src/main/scala/cats/syntax/foldable.scala b/core/src/main/scala/cats/syntax/foldable.scala index 87b8a204b9..78fed4ee7c 100644 --- a/core/src/main/scala/cats/syntax/foldable.scala +++ b/core/src/main/scala/cats/syntax/foldable.scala @@ -168,24 +168,24 @@ final class FoldableOps[F[_], A](private val fa: F[A]) extends AnyVal { /** * Tear down a subset of this structure using a `PartialFunction`. - *{{{ + * {{{ * scala> import cats.implicits._ * scala> val xs = List(1, 2, 3, 4) * scala> xs.collectFold { case n if n % 2 == 0 => n } * res0: Int = 6 - *}}} + * }}} */ def collectFold[M](f: PartialFunction[A, M])(implicit F: Foldable[F], M: Monoid[M]): M = F.collectFold[A, M](fa)(f) /** * Tear down a subset of this structure using a `A => Option[M]`. - *{{{ + * {{{ * scala> import cats.implicits._ * scala> val xs = List(1, 2, 3, 4) * scala> def f(n: Int): Option[Int] = if (n % 2 == 0) Some(n) else None * scala> xs.collectFoldSome(f) * res0: Int = 6 - *}}} + * }}} */ @deprecated("Use collectFoldSome", "2.1.0-RC1") def collectSomeFold[M](f: A => Option[M])(implicit F: Foldable[F], M: Monoid[M]): M = F.collectFoldSome[A, M](fa)(f) @@ -224,7 +224,7 @@ final class FoldableOps0[F[_], A](private val fa: F[A]) extends AnyVal { * scala> val a = x("foo") * a: String = "foo321" * }}} - * */ + */ def foldMapK[G[_], B](f: A => G[B])(implicit F: Foldable[F], G: MonoidK[G]): G[B] = F.foldMapK(fa)(f) /** diff --git a/core/src/main/scala/cats/syntax/list.scala b/core/src/main/scala/cats/syntax/list.scala index fee7388ca1..f1878ec29e 100644 --- a/core/src/main/scala/cats/syntax/list.scala +++ b/core/src/main/scala/cats/syntax/list.scala @@ -77,7 +77,8 @@ final class ListOps[A](private val la: List[A]) extends AnyVal { ) } - /** Produces a `NonEmptyList` containing cumulative results of applying the + /** + * Produces a `NonEmptyList` containing cumulative results of applying the * operator going left to right. * * Example: @@ -97,7 +98,8 @@ final class ListOps[A](private val la: List[A]) extends AnyVal { def scanLeftNel[B](b: B)(f: (B, A) => B): NonEmptyList[B] = NonEmptyList.fromListUnsafe(la.scanLeft(b)(f)) - /** Produces a `NonEmptyList` containing cumulative results of applying the + /** + * Produces a `NonEmptyList` containing cumulative results of applying the * operator going right to left. * * Example: diff --git a/core/src/main/scala/cats/syntax/reducible.scala b/core/src/main/scala/cats/syntax/reducible.scala index 0b542c8742..415a723ee5 100644 --- a/core/src/main/scala/cats/syntax/reducible.scala +++ b/core/src/main/scala/cats/syntax/reducible.scala @@ -28,7 +28,7 @@ final class ReducibleOps0[F[_], A](private val fa: F[A]) extends AnyVal { * scala> val a = x("foo") * a: String = "foo321" * }}} - * */ + */ def reduceMapK[G[_], B](f: A => G[B])(implicit F: Reducible[F], G: SemigroupK[G]): G[B] = F.reduceMapK[G, A, B](fa)(f) def reduceA[G[_], B](implicit F: Reducible[F], ev: A <:< G[B], G: Apply[G], B: Semigroup[B]): G[B] = diff --git a/core/src/main/scala/cats/syntax/traverseFilter.scala b/core/src/main/scala/cats/syntax/traverseFilter.scala index 36c57b62a7..c3ff4b95c4 100644 --- a/core/src/main/scala/cats/syntax/traverseFilter.scala +++ b/core/src/main/scala/cats/syntax/traverseFilter.scala @@ -17,6 +17,6 @@ final class SequenceFilterOps[F[_], G[_], A](private val fgoa: F[G[Option[A]]]) * scala> val b: Either[String, List[Int]] = a.sequenceFilter * b: Either[String, List[Int]] = Right(List(1, 5, 3)) * }}} - * */ + */ def sequenceFilter(implicit F: TraverseFilter[F], G: Applicative[G]): G[F[A]] = F.sequenceFilter(fgoa) } diff --git a/free/src/main/scala/cats/free/Cofree.scala b/free/src/main/scala/cats/free/Cofree.scala index c8e8145519..d2b203090f 100644 --- a/free/src/main/scala/cats/free/Cofree.scala +++ b/free/src/main/scala/cats/free/Cofree.scala @@ -13,45 +13,56 @@ package free */ final case class Cofree[S[_], A](head: A, tail: Eval[S[Cofree[S, A]]]) { - /** Evaluates and returns the tail of the computation. */ + /** + * Evaluates and returns the tail of the computation. */ def tailForced: S[Cofree[S, A]] = tail.value - /** Applies `f` to the head and `g` to the tail. */ + /** + * Applies `f` to the head and `g` to the tail. */ def transform[B](f: A => B, g: Cofree[S, A] => Cofree[S, B])(implicit S: Functor[S]): Cofree[S, B] = Cofree[S, B](f(head), tail.map(S.map(_)(g))) - /** Map over head and inner `S[_]` branches. */ + /** + * Map over head and inner `S[_]` branches. */ def map[B](f: A => B)(implicit S: Functor[S]): Cofree[S, B] = transform(f, _.map(f)) - /** Transform the branching functor at the root of the Cofree tree. */ + /** + * Transform the branching functor at the root of the Cofree tree. */ def mapBranchingRoot(nat: S ~> S)(implicit S: Functor[S]): Cofree[S, A] = Cofree[S, A](head, tail.map(nat(_))) - /** Transform the branching functor, using the S functor to perform the recursion. */ + /** + * Transform the branching functor, using the S functor to perform the recursion. */ def mapBranchingS[T[_]](nat: S ~> T)(implicit S: Functor[S]): Cofree[T, A] = Cofree[T, A](head, tail.map(v => nat(S.map(v)(_.mapBranchingS(nat))))) - /** Transform the branching functor, using the T functor to perform the recursion. */ + /** + * Transform the branching functor, using the T functor to perform the recursion. */ def mapBranchingT[T[_]](nat: S ~> T)(implicit T: Functor[T]): Cofree[T, A] = Cofree.anaEval(this)(_.tail.map(nat(_)), _.head) - /** Map `f` over each subtree of the computation. */ + /** + * Map `f` over each subtree of the computation. */ def coflatMap[B](f: Cofree[S, A] => B)(implicit S: Functor[S]): Cofree[S, B] = Cofree.anaEval(this)(_.tail, f) - /** Replace each node in the computation with the subtree from that node downwards */ + /** + * Replace each node in the computation with the subtree from that node downwards */ def coflatten(implicit S: Functor[S]): Cofree[S, Cofree[S, A]] = Cofree.anaEval(this)(_.tail, identity) - /** Alias for head. */ + /** + * Alias for head. */ def extract: A = head - /** Evaluate just the tail. */ + /** + * Evaluate just the tail. */ def forceTail: Cofree[S, A] = Cofree[S, A](head, Eval.now(tail.value)) - /** Evaluate the entire Cofree tree. */ + /** + * Evaluate the entire Cofree tree. */ def forceAll(implicit S: Functor[S]): Cofree[S, A] = Cofree.anaEval(this)(sa => Eval.now(sa.tail.value), _.head) @@ -59,15 +70,18 @@ final case class Cofree[S[_], A](head: A, tail: Eval[S[Cofree[S, A]]]) { object Cofree extends CofreeInstances { - /** Cofree anamorphism, lazily evaluated. */ + /** + * Cofree anamorphism, lazily evaluated. */ def unfold[F[_], A](a: A)(f: A => F[A])(implicit F: Functor[F]): Cofree[F, A] = ana(a)(f, identity) - /** Cofree anamorphism with a fused map, lazily evaluated. */ + /** + * Cofree anamorphism with a fused map, lazily evaluated. */ def ana[F[_], A, B](a: A)(coalg: A => F[A], f: A => B)(implicit F: Functor[F]): Cofree[F, B] = anaEval(a)(a => Eval.later(coalg(a)), f) - /** Cofree anamorphism with a fused map. */ + /** + * Cofree anamorphism with a fused map. */ def anaEval[F[_], A, B](a: A)(coalg: A => Eval[F[A]], f: A => B)(implicit F: Functor[F]): Cofree[F, B] = Cofree[F, B](f(a), mapSemilazy(coalg(a))(fa => F.map(fa)(anaEval(_)(coalg, f)))) diff --git a/free/src/main/scala/cats/free/ContravariantCoyoneda.scala b/free/src/main/scala/cats/free/ContravariantCoyoneda.scala index 2e9d6c3f77..d751888943 100644 --- a/free/src/main/scala/cats/free/ContravariantCoyoneda.scala +++ b/free/src/main/scala/cats/free/ContravariantCoyoneda.scala @@ -9,30 +9,38 @@ package free sealed abstract class ContravariantCoyoneda[F[_], A] extends Serializable { self => import ContravariantCoyoneda.{unsafeApply, Aux} - /** The pivot between `fi` and `k`, usually existential. */ + /** + * The pivot between `fi` and `k`, usually existential. */ type Pivot - /** The underlying value. */ + /** + * The underlying value. */ val fi: F[Pivot] - /** The list of transformer functions, to be composed and lifted into `F` by `run`. */ + /** + * The list of transformer functions, to be composed and lifted into `F` by `run`. */ private[cats] val ks: List[Any => Any] - /** The composed transformer function, to be lifted into `F` by `run`. */ + /** + * The composed transformer function, to be lifted into `F` by `run`. */ final def k: A => Pivot = Function.chain(ks)(_).asInstanceOf[Pivot] - /** Converts to `F[A]` given that `F` is a contravariant functor */ + /** + * Converts to `F[A]` given that `F` is a contravariant functor */ final def run(implicit F: Contravariant[F]): F[A] = F.contramap(fi)(k) - /** Converts to `G[A]` given that `G` is a contravariant functor */ + /** + * Converts to `G[A]` given that `G` is a contravariant functor */ final def foldMap[G[_]](trans: F ~> G)(implicit G: Contravariant[G]): G[A] = G.contramap(trans(fi))(k) - /** Simple function composition. Allows contramap fusion without touching the underlying `F`. */ + /** + * Simple function composition. Allows contramap fusion without touching the underlying `F`. */ final def contramap[B](f: B => A): Aux[F, B, Pivot] = unsafeApply(fi)(f.asInstanceOf[Any => Any] :: ks) - /** Modify the context `F` using transformation `f`. */ + /** + * Modify the context `F` using transformation `f`. */ final def mapK[G[_]](f: F ~> G): Aux[G, A, Pivot] = unsafeApply(f(fi))(ks) @@ -46,11 +54,13 @@ object ContravariantCoyoneda { */ type Aux[F[_], A, B] = ContravariantCoyoneda[F, A] { type Pivot = B } - /** `F[A]` converts to `ContravariantCoyoneda[F,A]` for any `F` */ + /** + * `F[A]` converts to `ContravariantCoyoneda[F,A]` for any `F` */ def lift[F[_], A](fa: F[A]): ContravariantCoyoneda[F, A] = apply(fa)(identity[A]) - /** Like `lift(fa).contramap(k0)`. */ + /** + * Like `lift(fa).contramap(k0)`. */ def apply[F[_], A, B](fa: F[A])(k0: B => A): Aux[F, B, A] = unsafeApply(fa)(k0.asInstanceOf[Any => Any] :: Nil) @@ -65,7 +75,8 @@ object ContravariantCoyoneda { val fi = fa } - /** `ContravariantCoyoneda[F, *]` provides a contravariant functor for any `F`. */ + /** + * `ContravariantCoyoneda[F, *]` provides a contravariant functor for any `F`. */ implicit def catsFreeContravariantFunctorForContravariantCoyoneda[F[_]]: Contravariant[ContravariantCoyoneda[F, *]] = new Contravariant[ContravariantCoyoneda[F, *]] { def contramap[A, B](cfa: ContravariantCoyoneda[F, A])(f: B => A): ContravariantCoyoneda[F, B] = diff --git a/free/src/main/scala/cats/free/Coyoneda.scala b/free/src/main/scala/cats/free/Coyoneda.scala index 682d9715af..f0348329bd 100644 --- a/free/src/main/scala/cats/free/Coyoneda.scala +++ b/free/src/main/scala/cats/free/Coyoneda.scala @@ -12,28 +12,35 @@ import cats.arrow.FunctionK */ sealed abstract class Coyoneda[F[_], A] extends Serializable { self => - /** The pivot between `fi` and `k`, usually existential. */ + /** + * The pivot between `fi` and `k`, usually existential. */ type Pivot - /** The underlying value. */ + /** + * The underlying value. */ val fi: F[Pivot] - /** The list of transformer functions, to be composed and lifted into `F` by `run`. */ + /** + * The list of transformer functions, to be composed and lifted into `F` by `run`. */ private[cats] val ks: List[Any => Any] - /** The list of transformer functions composed into a single function, to be lifted into `F` by `run`. */ + /** + * The list of transformer functions composed into a single function, to be lifted into `F` by `run`. */ final def k: Pivot => A = Function.chain(ks.reverse)(_).asInstanceOf[A] import Coyoneda.{unsafeApply, Aux} - /** Converts to `F[A]` given that `F` is a functor */ + /** + * Converts to `F[A]` given that `F` is a functor */ final def run(implicit F: Functor[F]): F[A] = F.map(fi)(k) - /** Converts to `G[A]` given that `G` is a functor */ + /** + * Converts to `G[A]` given that `G` is a functor */ final def foldMap[G[_]](trans: F ~> G)(implicit G: Functor[G]): G[A] = G.map(trans(fi))(k) - /** Converts to `Yoneda[F,A]` given that `F` is a functor */ + /** + * Converts to `Yoneda[F,A]` given that `F` is a functor */ final def toYoneda(implicit F: Functor[F]): Yoneda[F, A] = new Yoneda[F, A] { def apply[B](f: A => B): F[B] = F.map(fi)(k.andThen(f)) @@ -60,19 +67,23 @@ sealed abstract class Coyoneda[F[_], A] extends Serializable { self => object Coyoneda { - /** Lift the `Pivot` type member to a parameter. It is usually more + /** + * Lift the `Pivot` type member to a parameter. It is usually more * convenient to use `Aux` than a structural type. */ type Aux[F[_], A, B] = Coyoneda[F, A] { type Pivot = B } - /** `F[A]` converts to `Coyoneda[F,A]` for any `F` */ + /** + * `F[A]` converts to `Coyoneda[F,A]` for any `F` */ def lift[F[_], A](fa: F[A]): Coyoneda[F, A] = apply(fa)(identity[A]) - /** Like `lift(fa).map(k0)`. */ + /** + * Like `lift(fa).map(k0)`. */ def apply[F[_], A, B](fa: F[A])(k0: A => B): Aux[F, B, A] = unsafeApply(fa)(k0.asInstanceOf[Any => Any] :: Nil) - /** Creates a `Coyoneda[F, A]` for any `F`, taking an `F[A]` + /** + * Creates a `Coyoneda[F, A]` for any `F`, taking an `F[A]` * and a list of [[Functor.map]]ped functions to apply later */ private[cats] def unsafeApply[F[_], A, B](fa: F[A])(ks0: List[Any => Any]): Aux[F, B, A] = diff --git a/free/src/main/scala/cats/free/Free.scala b/free/src/main/scala/cats/free/Free.scala index f2e8baf7e7..44d8d243dc 100644 --- a/free/src/main/scala/cats/free/Free.scala +++ b/free/src/main/scala/cats/free/Free.scala @@ -46,7 +46,8 @@ sealed abstract class Free[S[_], A] extends Product with Serializable { final def fold[B](r: A => B, s: S[Free[S, A]] => B)(implicit S: Functor[S]): B = resume.fold(s, r) - /** Takes one evaluation step in the Free monad, re-associating left-nested binds in the process. */ + /** + * Takes one evaluation step in the Free monad, re-associating left-nested binds in the process. */ @tailrec final def step: Free[S, A] = this match { @@ -173,16 +174,16 @@ sealed abstract class Free[S[_], A] extends Product with Serializable { * Lift into `G` (typically a `EitherK`) given `InjectK`. Analogous * to `Free.inject` but lifts programs rather than constructors. * - *{{{ - *scala> type Lo[A] = cats.data.EitherK[List, Option, A] - *defined type alias Lo + * {{{ + * scala> type Lo[A] = cats.data.EitherK[List, Option, A] + * defined type alias Lo * - *scala> val fo = Free.liftF(Option("foo")) - *fo: cats.free.Free[Option,String] = Free(...) + * scala> val fo = Free.liftF(Option("foo")) + * fo: cats.free.Free[Option,String] = Free(...) * - *scala> fo.inject[Lo] - *res4: cats.free.Free[Lo,String] = Free(...) - *}}} + * scala> fo.inject[Lo] + * res4: cats.free.Free[Lo,String] = Free(...) + * }}} */ final def inject[G[_]](implicit ev: InjectK[S, G]): Free[G, A] = mapK(new (S ~> G) { def apply[B](sb: S[B]): G[B] = ev.inj(sb) }) @@ -201,10 +202,12 @@ object Free extends FreeInstances { */ final private[free] case class Pure[S[_], A](a: A) extends Free[S, A] - /** Suspend the computation with the given suspension. */ + /** + * Suspend the computation with the given suspension. */ final private[free] case class Suspend[S[_], A](a: S[A]) extends Free[S, A] - /** Call a subroutine and continue with the given function. */ + /** + * Call a subroutine and continue with the given function. */ final private[free] case class FlatMapped[S[_], B, C](c: Free[S, C], f: C => Free[S, B]) extends Free[S, B] /** diff --git a/free/src/main/scala/cats/free/FreeApplicative.scala b/free/src/main/scala/cats/free/FreeApplicative.scala index efbfa80977..e2c9ee545a 100644 --- a/free/src/main/scala/cats/free/FreeApplicative.scala +++ b/free/src/main/scala/cats/free/FreeApplicative.scala @@ -40,7 +40,8 @@ sealed abstract class FreeApplicative[F[_], A] extends Product with Serializable } } - /** Interprets/Runs the sequence of operations using the semantics of `Applicative` G[_]. + /** + * Interprets/Runs the sequence of operations using the semantics of `Applicative` G[_]. * Tail recursive. */ // scalastyle:off method.length @@ -151,13 +152,15 @@ sealed abstract class FreeApplicative[F[_], A] extends Product with Serializable def flatCompile[G[_]](f: F ~> FA[G, *]): FA[G, A] = foldMap(f) - /** Interpret this algebra into a Monoid. */ + /** + * 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[B](fb: F[B]): Const[M, B] = Const(f(fb)) } ).getConst - /** Compile this FreeApplicative algebra into a Free algebra. */ + /** + * Compile this FreeApplicative algebra into a Free algebra. */ final def monad: Free[F, A] = foldMap[Free[F, *]] { new FunctionK[F, Free[F, *]] { def apply[B](fb: F[B]): Free[F, B] = Free.liftF(fb) } @@ -177,7 +180,8 @@ object FreeApplicative { case x => throw new RuntimeException(s"Impossible for a $x to reach here") } - /** Represents a curried function `F[A => B => C => ...]` + /** + * Represents a curried function `F[A => B => C => ...]` * that has been constructed with chained `ap` calls. * Fn#argc denotes the amount of curried params remaining. */ diff --git a/free/src/main/scala/cats/free/FreeInvariantMonoidal.scala b/free/src/main/scala/cats/free/FreeInvariantMonoidal.scala index 469da479db..e79529c6ee 100644 --- a/free/src/main/scala/cats/free/FreeInvariantMonoidal.scala +++ b/free/src/main/scala/cats/free/FreeInvariantMonoidal.scala @@ -16,22 +16,26 @@ sealed abstract class FreeInvariantMonoidal[F[_], A] extends Product with Serial def product[B](fb: FA[F, B]): FA[F, (A, B)] = Zip(this, fb) - /** Interprets/Runs the sequence of operations using the semantics of `InvariantMonoidal[G]` */ + /** + * Interprets/Runs the sequence of operations using the semantics of `InvariantMonoidal[G]` */ def foldMap[G[_]](nt: FunctionK[F, G])(implicit im: InvariantMonoidal[G]): G[A] // Note that implementing a concrete `foldMap` here does not work because // `Zip extends G[(A, B)]` confuses the type inferance when pattern matching on `this`. - /** Interpret/run the operations using the semantics of `InvariantMonoidal[F]`. */ + /** + * Interpret/run the operations using the semantics of `InvariantMonoidal[F]`. */ final def fold(implicit F: InvariantMonoidal[F]): F[A] = foldMap(FunctionK.id[F]) - /** Interpret this algebra into another InvariantMonoidal */ + /** + * 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[B](fb: F[B]): FA[G, B] = lift(f(fb)) } } - /** Interpret this algebra into a Monoid */ + /** + * 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[B](fb: F[B]): Const[M, B] = Const(f(fb)) } @@ -67,7 +71,8 @@ object FreeInvariantMonoidal { def lift[F[_], A](fa: F[A]): FA[F, A] = Suspend(fa) - /** `FreeInvariantMonoidal[S, *]` has a FreeInvariantMonoidal for any type constructor `S[_]`. */ + /** + * `FreeInvariantMonoidal[S, *]` has a FreeInvariantMonoidal for any type constructor `S[_]`. */ implicit def catsFreeInvariantMonoidal[S[_]]: InvariantMonoidal[FA[S, *]] = new InvariantMonoidal[FA[S, *]] { def unit: FA[S, Unit] = FreeInvariantMonoidal.pure(()) diff --git a/free/src/main/scala/cats/free/FreeT.scala b/free/src/main/scala/cats/free/FreeT.scala index 5e46381ec1..0697aad9ae 100644 --- a/free/src/main/scala/cats/free/FreeT.scala +++ b/free/src/main/scala/cats/free/FreeT.scala @@ -45,7 +45,8 @@ sealed abstract class FreeT[S[_], M[_], A] extends Product with Serializable { loop(mapK(mn)) } - /** Binds the given continuation to the result of this computation. */ + /** + * Binds the given continuation to the result of this computation. */ final def flatMap[B](f: A => FreeT[S, M, B]): FreeT[S, M, B] = FlatMapped(this, f) @@ -59,7 +60,8 @@ sealed abstract class FreeT[S[_], M[_], A] extends Product with Serializable { @deprecated("Use compile", "0.8.0") private[free] def interpret[T[_]](st: FunctionK[S, T])(implicit M: Functor[M]): FreeT[T, M, A] = compile(st) - /** Change the base functor `S` for a `FreeT` action. */ + /** + * Change the base functor `S` for a `FreeT` action. */ def compile[T[_]](st: FunctionK[S, T])(implicit M: Functor[M]): FreeT[T, M, A] = step match { case e @ FlatMapped(_, _) => @@ -94,7 +96,8 @@ sealed abstract class FreeT[S[_], M[_], A] extends Product with Serializable { M.tailRecM(this)(go) } - /** Evaluates a single layer of the free monad */ + /** + * Evaluates a single layer of the free monad */ def resume(implicit S: Functor[S], M: Monad[M]): M[Either[S[FreeT[S, M, A]], A]] = { def go(ft: FreeT[S, M, A]): M[Either[FreeT[S, M, A], Either[S[FreeT[S, M, A]], A]]] = ft match { @@ -165,10 +168,12 @@ sealed abstract class FreeT[S[_], M[_], A] extends Product with Serializable { object FreeT extends FreeTInstances { - /** Suspend the computation with the given suspension. */ + /** + * Suspend the computation with the given suspension. */ private[free] case class Suspend[S[_], M[_], A](a: M[Either[S[A], A]]) extends FreeT[S, M, A] - /** Call a subroutine and continue with the given function. */ + /** + * Call a subroutine and continue with the given function. */ private[free] case class FlatMapped[S[_], M[_], A0, B](a0: FreeT[S, M, A0], f0: A0 => FreeT[S, M, B]) extends FreeT[S, M, B] { type A = A0 @@ -176,7 +181,8 @@ object FreeT extends FreeTInstances { def f: A => FreeT[S, M, B] = f0 } - /** Return the given value in the free monad. */ + /** + * Return the given value in the free monad. */ def pure[S[_], M[_], A](value: A)(implicit M: Applicative[M]): FreeT[S, M, A] = Suspend(M.pure(Right(value))) @deprecated("Use FreeT.defer.", "1.0.0-MF") @@ -198,7 +204,8 @@ object FreeT extends FreeTInstances { def liftT[S[_], M[_], A](value: M[A])(implicit M: Functor[M]): FreeT[S, M, A] = Suspend(M.map(value)(Right(_))) - /** Suspends a value within a functor in a single step. Monadic unit for a higher-order monad. */ + /** + * Suspends a value within a functor in a single step. Monadic unit for a higher-order monad. */ def liftF[S[_], M[_], A](value: S[A])(implicit M: Applicative[M]): FreeT[S, M, A] = Suspend(M.pure(Left(value))) diff --git a/free/src/main/scala/cats/free/package.scala b/free/src/main/scala/cats/free/package.scala index 26d512c0ac..075c9ae188 100644 --- a/free/src/main/scala/cats/free/package.scala +++ b/free/src/main/scala/cats/free/package.scala @@ -2,7 +2,8 @@ package cats package object free { - /** Alias for the free monad over the `Function0` functor. */ + /** + * Alias for the free monad over the `Function0` functor. */ type Trampoline[A] = Free[Function0, A] object Trampoline extends TrampolineFunctions } diff --git a/kernel-laws/shared/src/main/scala/cats/kernel/laws/IsEq.scala b/kernel-laws/shared/src/main/scala/cats/kernel/laws/IsEq.scala index 0b8735e7b9..654ddabffc 100644 --- a/kernel-laws/shared/src/main/scala/cats/kernel/laws/IsEq.scala +++ b/kernel-laws/shared/src/main/scala/cats/kernel/laws/IsEq.scala @@ -1,5 +1,6 @@ package cats.kernel package laws -/** Represents two values of the same type that are expected to be equal. */ +/** + * Represents two values of the same type that are expected to be equal. */ final case class IsEq[A](lhs: A, rhs: A) diff --git a/kernel/src/main/scala-2.13+/cats/kernel/compat/HashCompat.scala b/kernel/src/main/scala-2.13+/cats/kernel/compat/HashCompat.scala index b941d71b58..f338b939cf 100644 --- a/kernel/src/main/scala-2.13+/cats/kernel/compat/HashCompat.scala +++ b/kernel/src/main/scala-2.13+/cats/kernel/compat/HashCompat.scala @@ -101,7 +101,8 @@ private[kernel] class HashCompat { } // adapted from scala.util.hashing.MurmurHash3 - /** Force all bits of the hash to avalanche. Used for finalizing the hash. */ + /** + * Force all bits of the hash to avalanche. Used for finalizing the hash. */ final protected def avalanche(hash: Int): Int = { var h = hash diff --git a/kernel/src/main/scala/cats/kernel/Comparison.scala b/kernel/src/main/scala/cats/kernel/Comparison.scala index 538aac88a4..13f02c667a 100644 --- a/kernel/src/main/scala/cats/kernel/Comparison.scala +++ b/kernel/src/main/scala/cats/kernel/Comparison.scala @@ -1,6 +1,7 @@ package cats.kernel -/** ADT encoding the possible results of a comparison */ +/** + * ADT encoding the possible results of a comparison */ sealed abstract class Comparison(val toInt: Int, val toDouble: Double) extends Product with Serializable object Comparison { diff --git a/kernel/src/main/scala/cats/kernel/Hash.scala b/kernel/src/main/scala/cats/kernel/Hash.scala index f25af8e4db..3cbe10e3e1 100644 --- a/kernel/src/main/scala/cats/kernel/Hash.scala +++ b/kernel/src/main/scala/cats/kernel/Hash.scala @@ -28,7 +28,8 @@ abstract class HashFunctions[H[T] <: Hash[T]] extends EqFunctions[H] { object Hash extends HashFunctions[Hash] { - /** Fetch a `Hash` instance given the specific type. */ + /** + * Fetch a `Hash` instance given the specific type. */ @inline final def apply[A](implicit ev: Hash[A]): Hash[A] = ev def by[@sp A, @sp B](f: A => B)(implicit ev: Hash[B]): Hash[A] = diff --git a/laws/src/main/scala/cats/laws/CommutativeArrowLaws.scala b/laws/src/main/scala/cats/laws/CommutativeArrowLaws.scala index 2b9e9bc138..61ead19bdd 100644 --- a/laws/src/main/scala/cats/laws/CommutativeArrowLaws.scala +++ b/laws/src/main/scala/cats/laws/CommutativeArrowLaws.scala @@ -5,7 +5,8 @@ import cats.arrow.CommutativeArrow import cats.syntax.compose._ import cats.syntax.strong._ -/** Reference: "Causal Commutative Arrows", Journal of Functional Programming +/** + * Reference: "Causal Commutative Arrows", Journal of Functional Programming * Figure 4. */ trait CommutativeArrowLaws[F[_, _]] extends ArrowLaws[F] { diff --git a/laws/src/main/scala/cats/laws/FoldableLaws.scala b/laws/src/main/scala/cats/laws/FoldableLaws.scala index 973650ba43..981e686b80 100644 --- a/laws/src/main/scala/cats/laws/FoldableLaws.scala +++ b/laws/src/main/scala/cats/laws/FoldableLaws.scala @@ -11,10 +11,9 @@ trait FoldableLaws[F[_]] extends UnorderedFoldableLaws[F] { def foldRightLazy[A](fa: F[A]): Boolean = { var i = 0 F.foldRight(fa, Eval.now("empty")) { (_, _) => - i += 1 - Eval.now("not empty") - } - .value + i += 1 + Eval.now("not empty") + }.value i == (if (F.isEmpty(fa)) 0 else 1) } diff --git a/laws/src/main/scala/cats/laws/StrongLaws.scala b/laws/src/main/scala/cats/laws/StrongLaws.scala index 1001e1abee..4f01499b03 100644 --- a/laws/src/main/scala/cats/laws/StrongLaws.scala +++ b/laws/src/main/scala/cats/laws/StrongLaws.scala @@ -16,44 +16,52 @@ trait StrongLaws[F[_, _]] extends ProfunctorLaws[F] { private def swapTuple[X, Y]: Tuple2[X, Y] => Tuple2[Y, X] = _.swap - /** first' == dimap swap swap . second' */ + /** + * first' == dimap swap swap . second' */ def firstIsSwappedSecond[A, B, C](fab: F[A, B]): IsEq[F[(A, C), (B, C)]] = fab.first[C] <-> fab.second[C].dimap(swapTuple[A, C])(swapTuple[C, B]) - /** second' == dimap swap swap . first' */ + /** + * second' == dimap swap swap . first' */ def secondIsSwappedFirst[A, B, C](fab: F[A, B]): IsEq[F[(C, A), (C, B)]] = fab.second[C] <-> fab.first[C].dimap(swapTuple[C, A])(swapTuple[B, C]) - /** lmap fst == rmap fst . first' */ + /** + * lmap fst == rmap fst . first' */ def lmapEqualsFirstAndThenRmap[A, B, C](fab: F[A, B]): IsEq[F[(A, C), B]] = fab.lmap[(A, C)]({ case (a, _) => a }) <-> fab.first[C].rmap[B](_._1) - /** lmap snd == rmap snd . second' */ + /** + * lmap snd == rmap snd . second' */ def lmapEqualsSecondAndThenRmap[A, B, C](fab: F[A, B]): IsEq[F[(C, A), B]] = fab.lmap[(C, A)]({ case (_, b) => b }) <-> fab.second[C].rmap[B](_._2) private def mapFirst[X, Y, Z](f: X => Z)(cb: (X, Y)): (Z, Y) = (f(cb._1), cb._2) private def mapSecond[X, Y, Z](f: Y => Z)(cb: (X, Y)): (X, Z) = (cb._1, f(cb._2)) - /** lmap (second f) . first == rmap (second f) . first */ + /** + * lmap (second f) . first == rmap (second f) . first */ def dinaturalityFirst[A, B, C, D](fab: F[A, B], f: C => D): IsEq[F[(A, C), (B, D)]] = fab.first[C].rmap(mapSecond(f)) <-> fab.first[D].lmap(mapSecond(f)) - /** lmap (first f) . second == rmap (first f) . second */ + /** + * lmap (first f) . second == rmap (first f) . second */ def dinaturalitySecond[A, B, C, D](fab: F[A, B], f: C => D): IsEq[F[(C, A), (D, B)]] = fab.second[C].rmap(mapFirst(f)) <-> fab.second[D].lmap(mapFirst(f)) private def assoc[A, B, C]: (((A, B), C)) => (A, (B, C)) = { case ((a, c), d) => (a, (c, d)) } private def unassoc[A, B, C]: ((A, (B, C))) => ((A, B), C) = { case (a, (c, d)) => ((a, c), d) } - /** first' . first' == dimap assoc unassoc . first' where + /** + * first' . first' == dimap assoc unassoc . first' where * assoc ((a,b),c) = (a,(b,c)) * unassoc (a,(b,c)) = ((a,b),c) */ def firstFirstIsDimap[A, B, C, D](fab: F[A, B]): IsEq[F[((A, C), D), ((B, C), D)]] = fab.first[C].first[D] <-> fab.first[(C, D)].dimap[((A, C), D), ((B, C), D)](assoc)(unassoc) - /** second' . second' == dimap unassoc assoc . second' where + /** + * second' . second' == dimap unassoc assoc . second' where * assoc ((a,b),c) = (a,(b,c)) * unassoc (a,(b,c)) = ((a,b),c) */ diff --git a/laws/src/main/scala/cats/laws/discipline/Eq.scala b/laws/src/main/scala/cats/laws/discipline/Eq.scala index 9518e8e0c7..30cb024611 100644 --- a/laws/src/main/scala/cats/laws/discipline/Eq.scala +++ b/laws/src/main/scala/cats/laws/discipline/Eq.scala @@ -156,11 +156,13 @@ object eq { 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[AndThen]` instance, built by piggybacking on [[catsLawsEqForFn1]]. */ + /** + * `Eq[AndThen]` instance, built by piggybacking on [[catsLawsEqForFn1]]. */ implicit def catsLawsEqForAndThen[A, B](implicit A: Arbitrary[A], B: Eq[B]): Eq[AndThen[A, B]] = Eq.instance(catsLawsEqForFn1[A, B].eqv(_, _)) - /** Create an approximation of Eq[Show[A]] by using catsLawsEqForFn1[A, String] */ + /** + * Create an approximation of Eq[Show[A]] by using catsLawsEqForFn1[A, String] */ implicit def catsLawsEqForShow[A: Arbitrary]: Eq[Show[A]] = Eq.by[Show[A], A => String] { showInstance => (a: A) => showInstance.show(a) diff --git a/project/Boilerplate.scala b/project/Boilerplate.scala index d999516ea6..4644f6dd04 100644 --- a/project/Boilerplate.scala +++ b/project/Boilerplate.scala @@ -33,7 +33,8 @@ object Boilerplate { val header = "// auto-generated boilerplate by /project/Boilerplate.scala" // TODO: put something meaningful here? - /** Returns a seq of the generated files. As a side-effect, it actually generates them... */ + /** + * Returns a seq of the generated files. As a side-effect, it actually generates them... */ def gen(dir: File) = for (t <- templates) yield { val tgtFile = t.filename(dir) diff --git a/testkit/src/main/scala/cats/tests/ListWrapper.scala b/testkit/src/main/scala/cats/tests/ListWrapper.scala index c744fb7b48..8c8daa489a 100644 --- a/testkit/src/main/scala/cats/tests/ListWrapper.scala +++ b/testkit/src/main/scala/cats/tests/ListWrapper.scala @@ -4,7 +4,8 @@ package tests import org.scalacheck.{Arbitrary, Cogen} import org.scalacheck.Arbitrary.arbitrary -/** This data type exists purely for testing. +/** + * This data type exists purely for testing. * * The problem this type solves is to assist in picking up type class * instances that have more general constraints. @@ -130,7 +131,8 @@ object ListWrapper { val applicative: Applicative[ListWrapper] = alternative - /** apply is taken due to ListWrapper being a case class */ + /** + * apply is taken due to ListWrapper being a case class */ val applyInstance: Apply[ListWrapper] = alternative def monoidK: MonoidK[ListWrapper] = alternative diff --git a/tests/src/test/scala/cats/tests/BinCodecInvariantMonoidalSuite.scala b/tests/src/test/scala/cats/tests/BinCodecInvariantMonoidalSuite.scala index 0e5c42c0e3..3d2b73a68a 100644 --- a/tests/src/test/scala/cats/tests/BinCodecInvariantMonoidalSuite.scala +++ b/tests/src/test/scala/cats/tests/BinCodecInvariantMonoidalSuite.scala @@ -59,7 +59,8 @@ object BinCodecInvariantMonoidalSuite { ) } - /** A small amount of binary bits */ + /** + * A small amount of binary bits */ type Bin = MiniList[Boolean] /** @@ -71,10 +72,12 @@ object BinCodecInvariantMonoidalSuite { */ trait BinCodec[A] extends Serializable { self => - /** Reads the first value of a Bin, returning an optional value of type `A` and the remaining Bin. */ + /** + * Reads the first value of a Bin, returning an optional value of type `A` and the remaining Bin. */ def read(s: Bin): (Option[A], Bin) - /** Writes a value of type `A` to Bin format. */ + /** + * Writes a value of type `A` to Bin format. */ def write(a: A): Bin } From 06ce859ab5fdb91c3a3cb979b0a0990db95b9c8f Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Wed, 17 Jun 2020 14:53:46 -0500 Subject: [PATCH 5/6] Unfold single-line comments --- .scalafmt.conf | 1 + core/src/main/scala/cats/Apply.scala | 15 ++++--- core/src/main/scala/cats/Bifoldable.scala | 9 ++-- core/src/main/scala/cats/Bifunctor.scala | 3 +- core/src/main/scala/cats/Bitraverse.scala | 5 ++- core/src/main/scala/cats/Reducible.scala | 2 +- core/src/main/scala/cats/Show.scala | 6 ++- core/src/main/scala/cats/data/AndThen.scala | 3 +- core/src/main/scala/cats/data/Chain.scala | 15 ++++--- core/src/main/scala/cats/data/ContT.scala | 6 ++- core/src/main/scala/cats/data/EitherT.scala | 3 +- core/src/main/scala/cats/data/Func.scala | 6 ++- core/src/main/scala/cats/data/IorT.scala | 3 +- core/src/main/scala/cats/data/Kleisli.scala | 6 ++- .../main/scala/cats/data/NonEmptyChain.scala | 3 +- .../main/scala/cats/data/NonEmptyList.scala | 2 +- .../main/scala/cats/data/NonEmptyVector.scala | 11 +++-- core/src/main/scala/cats/package.scala | 6 ++- core/src/main/scala/cats/syntax/apply.scala | 6 ++- core/src/main/scala/cats/syntax/either.scala | 18 +++++--- core/src/main/scala/cats/syntax/eq.scala | 3 +- free/src/main/scala/cats/free/Cofree.scala | 42 ++++++++++++------- .../cats/free/ContravariantCoyoneda.scala | 33 ++++++++++----- free/src/main/scala/cats/free/Coyoneda.scala | 27 ++++++++---- free/src/main/scala/cats/free/Free.scala | 9 ++-- .../scala/cats/free/FreeApplicative.scala | 6 ++- .../cats/free/FreeInvariantMonoidal.scala | 15 ++++--- free/src/main/scala/cats/free/FreeT.scala | 21 ++++++---- free/src/main/scala/cats/free/package.scala | 3 +- .../main/scala/cats/kernel/laws/IsEq.scala | 3 +- .../cats/kernel/compat/HashCompat.scala | 3 +- .../main/scala/cats/kernel/Comparison.scala | 3 +- kernel/src/main/scala/cats/kernel/Hash.scala | 3 +- .../src/main/scala/cats/laws/StrongLaws.scala | 18 +++++--- .../main/scala/cats/laws/discipline/Eq.scala | 6 ++- project/Boilerplate.scala | 3 +- .../main/scala/cats/tests/ListWrapper.scala | 3 +- .../BinCodecInvariantMonoidalSuite.scala | 9 ++-- 38 files changed, 225 insertions(+), 114 deletions(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index 5e1fa818c6..f0eb78e149 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -9,3 +9,4 @@ rewrite.rules = [AvoidInfix, SortImports, RedundantParens, SortModifiers] docstrings = JavaDoc newlines.afterCurlyLambda = preserve docstrings.style = Asterisk +docstrings.oneline = unfold diff --git a/core/src/main/scala/cats/Apply.scala b/core/src/main/scala/cats/Apply.scala index b2db9dce22..a6d5f326c5 100644 --- a/core/src/main/scala/cats/Apply.scala +++ b/core/src/main/scala/cats/Apply.scala @@ -113,28 +113,33 @@ trait Apply[F[_]] extends Functor[F] with InvariantSemigroupal[F] with ApplyArit ap(map(fa)(a => (b: B) => (a, b)))(fb) /** - * Alias for [[ap]]. */ + * Alias for [[ap]]. + */ @inline final def <*>[A, B](ff: F[A => B])(fa: F[A]): F[B] = ap(ff)(fa) /** - * Alias for [[productR]]. */ + * Alias for [[productR]]. + */ @inline final def *>[A, B](fa: F[A])(fb: F[B]): F[B] = productR(fa)(fb) /** - * Alias for [[productL]]. */ + * Alias for [[productL]]. + */ @inline final def <*[A, B](fa: F[A])(fb: F[B]): F[A] = productL(fa)(fb) /** - * Alias for [[productR]]. */ + * Alias for [[productR]]. + */ @deprecated("Use *> or productR instead.", "1.0.0-RC2") @noop @inline final private[cats] def followedBy[A, B](fa: F[A])(fb: F[B]): F[B] = productR(fa)(fb) /** - * Alias for [[productL]]. */ + * Alias for [[productL]]. + */ @deprecated("Use <* or productL instead.", "1.0.0-RC2") @noop @inline final private[cats] def forEffect[A, B](fa: F[A])(fb: F[B]): F[A] = productL(fa)(fb) diff --git a/core/src/main/scala/cats/Bifoldable.scala b/core/src/main/scala/cats/Bifoldable.scala index ad82b4480b..24d11429e1 100644 --- a/core/src/main/scala/cats/Bifoldable.scala +++ b/core/src/main/scala/cats/Bifoldable.scala @@ -10,15 +10,18 @@ import scala.annotation.implicitNotFound @typeclass trait Bifoldable[F[_, _]] extends Serializable { self => /** - * Collapse the structure with a left-associative function */ + * Collapse the structure with a left-associative function + */ def bifoldLeft[A, B, C](fab: F[A, B], c: C)(f: (C, A) => C, g: (C, B) => C): C /** - * Collapse the structure with a right-associative function */ + * Collapse the structure with a right-associative function + */ def bifoldRight[A, B, C](fab: F[A, B], c: Eval[C])(f: (A, Eval[C]) => Eval[C], g: (B, Eval[C]) => Eval[C]): Eval[C] /** - * Collapse the structure by mapping each element to an element of a type that has a [[cats.Monoid]] */ + * Collapse the structure by mapping each element to an element of a type that has a [[cats.Monoid]] + */ def bifoldMap[A, B, C](fab: F[A, B])(f: A => C, g: B => C)(implicit C: Monoid[C]): C = bifoldLeft(fab, C.empty)( (c: C, a: A) => C.combine(c, f(a)), diff --git a/core/src/main/scala/cats/Bifunctor.scala b/core/src/main/scala/cats/Bifunctor.scala index f3338ba7d2..dc83ec5be5 100644 --- a/core/src/main/scala/cats/Bifunctor.scala +++ b/core/src/main/scala/cats/Bifunctor.scala @@ -37,7 +37,8 @@ import scala.annotation.implicitNotFound def leftMap[A, B, C](fab: F[A, B])(f: A => C): F[C, B] = bimap(fab)(f, identity) /** - * The composition of two Bifunctors is itself a Bifunctor */ + * The composition of two Bifunctors is itself a Bifunctor + */ def compose[G[_, _]](implicit G0: Bifunctor[G]): Bifunctor[λ[(α, β) => F[G[α, β], G[α, β]]]] = new ComposedBifunctor[F, G] { val F = self diff --git a/core/src/main/scala/cats/Bitraverse.scala b/core/src/main/scala/cats/Bitraverse.scala index d8800424a5..0a2035a80c 100644 --- a/core/src/main/scala/cats/Bitraverse.scala +++ b/core/src/main/scala/cats/Bitraverse.scala @@ -4,7 +4,7 @@ import simulacrum.{noop, typeclass} import scala.annotation.implicitNotFound /** - * A type class abstracting over types that give rise to two independent [[cats.Traverse]]s. + * A type class abstracting over types that give rise to two independent [[cats.Traverse]]s. */ @implicitNotFound("Could not find an instance of Bitraverse for ${F}") @typeclass trait Bitraverse[F[_, _]] extends Bifoldable[F] with Bifunctor[F] { self => @@ -55,7 +55,8 @@ import scala.annotation.implicitNotFound bitraverse(fab)(identity, identity) /** - * If F and G are both [[cats.Bitraverse]] then so is their composition F[G[_, _], G[_, _]] */ + * If F and G are both [[cats.Bitraverse]] then so is their composition F[G[_, _], G[_, _]] + */ def compose[G[_, _]](implicit ev: Bitraverse[G]): Bitraverse[λ[(α, β) => F[G[α, β], G[α, β]]]] = new ComposedBitraverse[F, G] { val F = self diff --git a/core/src/main/scala/cats/Reducible.scala b/core/src/main/scala/cats/Reducible.scala index 0e87b61ece..cc9958c349 100644 --- a/core/src/main/scala/cats/Reducible.scala +++ b/core/src/main/scala/cats/Reducible.scala @@ -79,7 +79,7 @@ import scala.annotation.implicitNotFound def reduceLeftTo[A, B](fa: F[A])(f: A => B)(g: (B, A) => B): B /** - * Monadic variant of [[reduceLeftTo]]. + * Monadic variant of [[reduceLeftTo]]. */ def reduceLeftM[G[_], A, B](fa: F[A])(f: A => G[B])(g: (B, A) => G[B])(implicit G: FlatMap[G]): G[B] = reduceLeftTo(fa)(f)((gb, a) => G.flatMap(gb)(g(_, a))) diff --git a/core/src/main/scala/cats/Show.scala b/core/src/main/scala/cats/Show.scala index 70d8133289..bf8a47db70 100644 --- a/core/src/main/scala/cats/Show.scala +++ b/core/src/main/scala/cats/Show.scala @@ -40,14 +40,16 @@ object Show extends ScalaVersionSpecificShowInstances with ShowInstances { } /** - * creates an instance of [[Show]] using the provided function */ + * creates an instance of [[Show]] using the provided function + */ def show[A](f: A => String): Show[A] = new Show[A] { def show(a: A): String = f(a) } /** - * creates an instance of [[Show]] using object toString */ + * creates an instance of [[Show]] using object toString + */ def fromToString[A]: Show[A] = new Show[A] { def show(a: A): String = a.toString diff --git a/core/src/main/scala/cats/data/AndThen.scala b/core/src/main/scala/cats/data/AndThen.scala index 42f96a1ee1..e61eda6deb 100644 --- a/core/src/main/scala/cats/data/AndThen.scala +++ b/core/src/main/scala/cats/data/AndThen.scala @@ -139,7 +139,8 @@ sealed abstract class AndThen[-T, +R] extends (T => R) with Product with Seriali object AndThen extends AndThenInstances0 { /** - * Builds an [[AndThen]] reference by wrapping a plain function. */ + * Builds an [[AndThen]] reference by wrapping a plain function. + */ def apply[A, B](f: A => B): AndThen[A, B] = f match { case ref: AndThen[A, B] @unchecked => ref diff --git a/core/src/main/scala/cats/data/Chain.scala b/core/src/main/scala/cats/data/Chain.scala index ac70bce537..5b4a1dbb17 100644 --- a/core/src/main/scala/cats/data/Chain.scala +++ b/core/src/main/scala/cats/data/Chain.scala @@ -596,31 +596,36 @@ object Chain extends ChainInstances { } /** - * Empty Chain. */ + * Empty Chain. + */ val nil: Chain[Nothing] = Empty def empty[A]: Chain[A] = nil /** - * Creates a Chain of 1 element. */ + * Creates a Chain of 1 element. + */ def one[A](a: A): Chain[A] = Singleton(a) /** - * Concatenates two Chains. */ + * Concatenates two Chains. + */ def concat[A](c: Chain[A], c2: Chain[A]): Chain[A] = if (c.isEmpty) c2 else if (c2.isEmpty) c else Append(c, c2) /** - * Creates a Chain from the specified sequence. */ + * Creates a Chain from the specified sequence. + */ def fromSeq[A](s: Seq[A]): Chain[A] = if (s.isEmpty) nil else if (s.lengthCompare(1) == 0) one(s.head) else Wrap(s) /** - * Creates a Chain from the specified elements. */ + * Creates a Chain from the specified elements. + */ def apply[A](as: A*): Chain[A] = fromSeq(as) diff --git a/core/src/main/scala/cats/data/ContT.scala b/core/src/main/scala/cats/data/ContT.scala index d4e515265a..2006507a4e 100644 --- a/core/src/main/scala/cats/data/ContT.scala +++ b/core/src/main/scala/cats/data/ContT.scala @@ -66,7 +66,8 @@ object ContT { } /** - * Lift a pure value into `ContT` */ + * Lift a pure value into `ContT` + */ def pure[M[_], A, B](b: B): ContT[M, A, B] = apply { cb => cb(b) @@ -154,7 +155,8 @@ object ContT { FromFn(AndThen(fn)) /** - * Similar to [[apply]] but evaluation of the argument is deferred. */ + * Similar to [[apply]] but evaluation of the argument is deferred. + */ def later[M[_], A, B](fn: => (B => M[A]) => M[A]): ContT[M, A, B] = DeferCont(() => FromFn(AndThen(fn))) diff --git a/core/src/main/scala/cats/data/EitherT.scala b/core/src/main/scala/cats/data/EitherT.scala index 3ed6cf26e0..5a1a17678c 100644 --- a/core/src/main/scala/cats/data/EitherT.scala +++ b/core/src/main/scala/cats/data/EitherT.scala @@ -845,7 +845,8 @@ object EitherT extends EitherTInstances { ) /** - * Similar to `fromOptionF` but the left is carried from monadic `F[_]` context when the option is `None` */ + * Similar to `fromOptionF` but the left is carried from monadic `F[_]` context when the option is `None` + */ final def fromOptionM[F[_], E, A](fopt: F[Option[A]], ifNone: => F[E])(implicit F: Monad[F]): EitherT[F, E, A] = EitherT( F.flatMap(fopt) { diff --git a/core/src/main/scala/cats/data/Func.scala b/core/src/main/scala/cats/data/Func.scala index 34b27d4ed0..0961864b38 100644 --- a/core/src/main/scala/cats/data/Func.scala +++ b/core/src/main/scala/cats/data/Func.scala @@ -23,14 +23,16 @@ sealed abstract class Func[F[_], A, B] { self => object Func extends FuncInstances { /** - * function `A => F[B]`. */ + * function `A => F[B]`. + */ def func[F[_], A, B](run0: A => F[B]): Func[F, A, B] = new Func[F, A, B] { def run: A => F[B] = run0 } /** - * applicative function. */ + * applicative function. + */ def appFunc[F[_], A, B](run0: A => F[B])(implicit FF: Applicative[F]): AppFunc[F, A, B] = new AppFunc[F, A, B] { def F: Applicative[F] = FF diff --git a/core/src/main/scala/cats/data/IorT.scala b/core/src/main/scala/cats/data/IorT.scala index 4a6686b4e8..bc81737b95 100644 --- a/core/src/main/scala/cats/data/IorT.scala +++ b/core/src/main/scala/cats/data/IorT.scala @@ -360,7 +360,8 @@ object IorT extends IorTInstances { IorT(F.map(foption)(_.fold[Ior[E, A]](Ior.left(ifNone))(Ior.right))) /** - * Similar to `fromOptionF` but the left is carried from monadic `F[_]` context when the option is `None` */ + * Similar to `fromOptionF` but the left is carried from monadic `F[_]` context when the option is `None` + */ final def fromOptionM[F[_], E, A](foption: F[Option[A]], ifNone: => F[E])(implicit F: Monad[F]): IorT[F, E, A] = IorT( F.flatMap(foption) { diff --git a/core/src/main/scala/cats/data/Kleisli.scala b/core/src/main/scala/cats/data/Kleisli.scala index 395fccfcc9..38f84c24b0 100644 --- a/core/src/main/scala/cats/data/Kleisli.scala +++ b/core/src/main/scala/cats/data/Kleisli.scala @@ -113,12 +113,14 @@ final case class Kleisli[F[_], -A, B](run: A => F[B]) { self => Kleisli { case (c, a) => F.map(run(a))(c -> _) } /** - * Discard computed B and yield the input value. */ + * Discard computed B and yield the input value. + */ def tap[AA <: A](implicit F: Functor[F]): Kleisli[F, AA, AA] = Kleisli(a => F.as(run(a), a)) /** - * Yield computed B combined with input value. */ + * Yield computed B combined with input value. + */ def tapWith[C, AA <: A](f: (AA, B) => C)(implicit F: Functor[F]): Kleisli[F, AA, C] = Kleisli(a => F.map(run(a))(b => f(a, b))) diff --git a/core/src/main/scala/cats/data/NonEmptyChain.scala b/core/src/main/scala/cats/data/NonEmptyChain.scala index 9e0602303f..12fa51e3ea 100644 --- a/core/src/main/scala/cats/data/NonEmptyChain.scala +++ b/core/src/main/scala/cats/data/NonEmptyChain.scala @@ -392,7 +392,8 @@ class NonEmptyChainOps[A](private val value: NonEmptyChain[A]) final def reverseIterator: Iterator[A] = toChain.reverseIterator /** - * Reverses this `NonEmptyChain` */ + * Reverses this `NonEmptyChain` + */ final def reverse: NonEmptyChain[A] = create(toChain.reverse) diff --git a/core/src/main/scala/cats/data/NonEmptyList.scala b/core/src/main/scala/cats/data/NonEmptyList.scala index f359a3d7ca..334ecfd629 100644 --- a/core/src/main/scala/cats/data/NonEmptyList.scala +++ b/core/src/main/scala/cats/data/NonEmptyList.scala @@ -69,7 +69,7 @@ final case class NonEmptyList[+A](head: A, tail: List[A]) extends NonEmptyCollec def length: Int = size /** - * Applies f to all the elements of the structure + * Applies f to all the elements of the structure */ def map[B](f: A => B): NonEmptyList[B] = NonEmptyList(f(head), tail.map(f)) diff --git a/core/src/main/scala/cats/data/NonEmptyVector.scala b/core/src/main/scala/cats/data/NonEmptyVector.scala index 7a992484de..3c1211d5df 100644 --- a/core/src/main/scala/cats/data/NonEmptyVector.scala +++ b/core/src/main/scala/cats/data/NonEmptyVector.scala @@ -20,16 +20,19 @@ final class NonEmptyVector[+A] private (val toVector: Vector[A]) with NonEmptyCollection[A, Vector, NonEmptyVector] { /** - * Gets the element at the index, if it exists */ + * Gets the element at the index, if it exists + */ def get(i: Int): Option[A] = toVector.lift(i) /** - * Gets the element at the index, or throws an exception if none exists */ + * Gets the element at the index, or throws an exception if none exists + */ def getUnsafe(i: Int): A = toVector(i) /** - * Updates the element at the index, if it exists */ + * Updates the element at the index, if it exists + */ def updated[AA >: A](i: Int, a: AA): Option[NonEmptyVector[AA]] = if (toVector.isDefinedAt(i)) Some(new NonEmptyVector(toVector.updated(i, a))) else None @@ -162,7 +165,7 @@ final class NonEmptyVector[+A] private (val toVector: Vector[A]) new NonEmptyVector(toVector.map(f)) /** - * Applies f to all elements and combines the result + * Applies f to all elements and combines the result */ def flatMap[B](f: A => NonEmptyVector[B]): NonEmptyVector[B] = new NonEmptyVector(toVector.flatMap(a => f(a).toVector)) diff --git a/core/src/main/scala/cats/package.scala b/core/src/main/scala/cats/package.scala index c5ae7bc9c5..3b5f624c2c 100644 --- a/core/src/main/scala/cats/package.scala +++ b/core/src/main/scala/cats/package.scala @@ -39,11 +39,13 @@ package object cats { type ⊤ = Any /** - * [[cats.InjectK]][F, G] */ + * [[cats.InjectK]][F, G] + */ type :<:[F[_], G[_]] = InjectK[F, G] /** - * [[cats.InjectK]][F, G] */ + * [[cats.InjectK]][F, G] + */ type :≺:[F[_], G[_]] = InjectK[F, G] /** diff --git a/core/src/main/scala/cats/syntax/apply.scala b/core/src/main/scala/cats/syntax/apply.scala index e9e985cb9b..5966eb3836 100644 --- a/core/src/main/scala/cats/syntax/apply.scala +++ b/core/src/main/scala/cats/syntax/apply.scala @@ -55,13 +55,15 @@ final class IfApplyOps[F[_]](private val fcond: F[Boolean]) extends AnyVal { final class ApplyOps[F[_], A](private val fa: F[A]) extends AnyVal { /** - * Alias for [[Apply.productR]]. */ + * Alias for [[Apply.productR]]. + */ @deprecated("Use *> or productR instead.", "1.0.0-RC2") @inline private[syntax] def followedBy[B](fb: F[B])(implicit F: Apply[F]): F[B] = F.productR(fa)(fb) /** - * Alias for [[Apply.productL]]. */ + * Alias for [[Apply.productL]]. + */ @deprecated("Use <* or productL instead.", "1.0.0-RC2") @inline private[syntax] def forEffect[B](fb: F[B])(implicit F: Apply[F]): F[A] = F.productL(fa)(fb) diff --git a/core/src/main/scala/cats/syntax/either.scala b/core/src/main/scala/cats/syntax/either.scala index b1ecf9822c..3a501cd1d0 100644 --- a/core/src/main/scala/cats/syntax/either.scala +++ b/core/src/main/scala/cats/syntax/either.scala @@ -391,32 +391,37 @@ final class EitherObjectOps(private val either: Either.type) extends AnyVal { // } /** - * Cached value of `Right(())` to avoid allocations for a common case. */ + * Cached value of `Right(())` to avoid allocations for a common case. + */ def unit[A]: Either[A, Unit] = EitherUtil.unit } final class LeftOps[A, B](private val left: Left[A, B]) extends AnyVal { /** - * Cast the right type parameter of the `Left`. */ + * Cast the right type parameter of the `Left`. + */ def rightCast[C]: Either[A, C] = left.asInstanceOf[Either[A, C]] } final class RightOps[A, B](private val right: Right[A, B]) extends AnyVal { /** - * Cast the left type parameter of the `Right`. */ + * Cast the left type parameter of the `Right`. + */ def leftCast[C]: Either[C, B] = right.asInstanceOf[Either[C, B]] } final class EitherIdOps[A](private val obj: A) extends AnyVal { /** - * Wrap a value in `Left`. */ + * Wrap a value in `Left`. + */ def asLeft[B]: Either[A, B] = Left(obj) /** - * Wrap a value in `Right`. */ + * Wrap a value in `Right`. + */ def asRight[B]: Either[B, A] = Right(obj) /** @@ -493,7 +498,8 @@ final private[syntax] class EitherOpsBinCompat0[A, B](private val value: Either[ } /** - * Convenience methods to use `Either` syntax inside `Either` syntax definitions. */ + * Convenience methods to use `Either` syntax inside `Either` syntax definitions. + */ private[cats] object EitherUtil { def leftCast[A, B, C](right: Right[A, B]): Either[C, B] = right.asInstanceOf[Either[C, B]] diff --git a/core/src/main/scala/cats/syntax/eq.scala b/core/src/main/scala/cats/syntax/eq.scala index 114290ac44..29f9c8f4ef 100644 --- a/core/src/main/scala/cats/syntax/eq.scala +++ b/core/src/main/scala/cats/syntax/eq.scala @@ -4,7 +4,8 @@ package syntax trait EqSyntax { /** - * not final so it can be disabled in favor of scalactic equality in tests */ + * not final so it can be disabled in favor of scalactic equality in tests + */ implicit def catsSyntaxEq[A: Eq](a: A): EqOps[A] = new EqOps[A](a) } diff --git a/free/src/main/scala/cats/free/Cofree.scala b/free/src/main/scala/cats/free/Cofree.scala index d2b203090f..5d5fa6613d 100644 --- a/free/src/main/scala/cats/free/Cofree.scala +++ b/free/src/main/scala/cats/free/Cofree.scala @@ -14,55 +14,66 @@ package free final case class Cofree[S[_], A](head: A, tail: Eval[S[Cofree[S, A]]]) { /** - * Evaluates and returns the tail of the computation. */ + * Evaluates and returns the tail of the computation. + */ def tailForced: S[Cofree[S, A]] = tail.value /** - * Applies `f` to the head and `g` to the tail. */ + * Applies `f` to the head and `g` to the tail. + */ def transform[B](f: A => B, g: Cofree[S, A] => Cofree[S, B])(implicit S: Functor[S]): Cofree[S, B] = Cofree[S, B](f(head), tail.map(S.map(_)(g))) /** - * Map over head and inner `S[_]` branches. */ + * Map over head and inner `S[_]` branches. + */ def map[B](f: A => B)(implicit S: Functor[S]): Cofree[S, B] = transform(f, _.map(f)) /** - * Transform the branching functor at the root of the Cofree tree. */ + * Transform the branching functor at the root of the Cofree tree. + */ def mapBranchingRoot(nat: S ~> S)(implicit S: Functor[S]): Cofree[S, A] = Cofree[S, A](head, tail.map(nat(_))) /** - * Transform the branching functor, using the S functor to perform the recursion. */ + * Transform the branching functor, using the S functor to perform the recursion. + */ def mapBranchingS[T[_]](nat: S ~> T)(implicit S: Functor[S]): Cofree[T, A] = Cofree[T, A](head, tail.map(v => nat(S.map(v)(_.mapBranchingS(nat))))) /** - * Transform the branching functor, using the T functor to perform the recursion. */ + * Transform the branching functor, using the T functor to perform the recursion. + */ def mapBranchingT[T[_]](nat: S ~> T)(implicit T: Functor[T]): Cofree[T, A] = Cofree.anaEval(this)(_.tail.map(nat(_)), _.head) /** - * Map `f` over each subtree of the computation. */ + * Map `f` over each subtree of the computation. + */ def coflatMap[B](f: Cofree[S, A] => B)(implicit S: Functor[S]): Cofree[S, B] = Cofree.anaEval(this)(_.tail, f) /** - * Replace each node in the computation with the subtree from that node downwards */ + * Replace each node in the computation with the subtree from that node downwards + */ def coflatten(implicit S: Functor[S]): Cofree[S, Cofree[S, A]] = Cofree.anaEval(this)(_.tail, identity) /** - * Alias for head. */ + * Alias for head. + */ def extract: A = head /** - * Evaluate just the tail. */ + * Evaluate just the tail. + */ def forceTail: Cofree[S, A] = Cofree[S, A](head, Eval.now(tail.value)) /** - * Evaluate the entire Cofree tree. */ + * Evaluate the entire Cofree tree. + */ def forceAll(implicit S: Functor[S]): Cofree[S, A] = Cofree.anaEval(this)(sa => Eval.now(sa.tail.value), _.head) @@ -71,17 +82,20 @@ final case class Cofree[S[_], A](head: A, tail: Eval[S[Cofree[S, A]]]) { object Cofree extends CofreeInstances { /** - * Cofree anamorphism, lazily evaluated. */ + * Cofree anamorphism, lazily evaluated. + */ def unfold[F[_], A](a: A)(f: A => F[A])(implicit F: Functor[F]): Cofree[F, A] = ana(a)(f, identity) /** - * Cofree anamorphism with a fused map, lazily evaluated. */ + * Cofree anamorphism with a fused map, lazily evaluated. + */ def ana[F[_], A, B](a: A)(coalg: A => F[A], f: A => B)(implicit F: Functor[F]): Cofree[F, B] = anaEval(a)(a => Eval.later(coalg(a)), f) /** - * Cofree anamorphism with a fused map. */ + * Cofree anamorphism with a fused map. + */ def anaEval[F[_], A, B](a: A)(coalg: A => Eval[F[A]], f: A => B)(implicit F: Functor[F]): Cofree[F, B] = Cofree[F, B](f(a), mapSemilazy(coalg(a))(fa => F.map(fa)(anaEval(_)(coalg, f)))) diff --git a/free/src/main/scala/cats/free/ContravariantCoyoneda.scala b/free/src/main/scala/cats/free/ContravariantCoyoneda.scala index d751888943..57760f08ab 100644 --- a/free/src/main/scala/cats/free/ContravariantCoyoneda.scala +++ b/free/src/main/scala/cats/free/ContravariantCoyoneda.scala @@ -10,37 +10,45 @@ sealed abstract class ContravariantCoyoneda[F[_], A] extends Serializable { self import ContravariantCoyoneda.{unsafeApply, Aux} /** - * The pivot between `fi` and `k`, usually existential. */ + * The pivot between `fi` and `k`, usually existential. + */ type Pivot /** - * The underlying value. */ + * The underlying value. + */ val fi: F[Pivot] /** - * The list of transformer functions, to be composed and lifted into `F` by `run`. */ + * The list of transformer functions, to be composed and lifted into `F` by `run`. + */ private[cats] val ks: List[Any => Any] /** - * The composed transformer function, to be lifted into `F` by `run`. */ + * The composed transformer function, to be lifted into `F` by `run`. + */ final def k: A => Pivot = Function.chain(ks)(_).asInstanceOf[Pivot] /** - * Converts to `F[A]` given that `F` is a contravariant functor */ + * Converts to `F[A]` given that `F` is a contravariant functor + */ final def run(implicit F: Contravariant[F]): F[A] = F.contramap(fi)(k) /** - * Converts to `G[A]` given that `G` is a contravariant functor */ + * Converts to `G[A]` given that `G` is a contravariant functor + */ final def foldMap[G[_]](trans: F ~> G)(implicit G: Contravariant[G]): G[A] = G.contramap(trans(fi))(k) /** - * Simple function composition. Allows contramap fusion without touching the underlying `F`. */ + * Simple function composition. Allows contramap fusion without touching the underlying `F`. + */ final def contramap[B](f: B => A): Aux[F, B, Pivot] = unsafeApply(fi)(f.asInstanceOf[Any => Any] :: ks) /** - * Modify the context `F` using transformation `f`. */ + * Modify the context `F` using transformation `f`. + */ final def mapK[G[_]](f: F ~> G): Aux[G, A, Pivot] = unsafeApply(f(fi))(ks) @@ -55,12 +63,14 @@ object ContravariantCoyoneda { type Aux[F[_], A, B] = ContravariantCoyoneda[F, A] { type Pivot = B } /** - * `F[A]` converts to `ContravariantCoyoneda[F,A]` for any `F` */ + * `F[A]` converts to `ContravariantCoyoneda[F,A]` for any `F` + */ def lift[F[_], A](fa: F[A]): ContravariantCoyoneda[F, A] = apply(fa)(identity[A]) /** - * Like `lift(fa).contramap(k0)`. */ + * Like `lift(fa).contramap(k0)`. + */ def apply[F[_], A, B](fa: F[A])(k0: B => A): Aux[F, B, A] = unsafeApply(fa)(k0.asInstanceOf[Any => Any] :: Nil) @@ -76,7 +86,8 @@ object ContravariantCoyoneda { } /** - * `ContravariantCoyoneda[F, *]` provides a contravariant functor for any `F`. */ + * `ContravariantCoyoneda[F, *]` provides a contravariant functor for any `F`. + */ implicit def catsFreeContravariantFunctorForContravariantCoyoneda[F[_]]: Contravariant[ContravariantCoyoneda[F, *]] = new Contravariant[ContravariantCoyoneda[F, *]] { def contramap[A, B](cfa: ContravariantCoyoneda[F, A])(f: B => A): ContravariantCoyoneda[F, B] = diff --git a/free/src/main/scala/cats/free/Coyoneda.scala b/free/src/main/scala/cats/free/Coyoneda.scala index f0348329bd..7f40ab83ae 100644 --- a/free/src/main/scala/cats/free/Coyoneda.scala +++ b/free/src/main/scala/cats/free/Coyoneda.scala @@ -13,34 +13,41 @@ import cats.arrow.FunctionK sealed abstract class Coyoneda[F[_], A] extends Serializable { self => /** - * The pivot between `fi` and `k`, usually existential. */ + * The pivot between `fi` and `k`, usually existential. + */ type Pivot /** - * The underlying value. */ + * The underlying value. + */ val fi: F[Pivot] /** - * The list of transformer functions, to be composed and lifted into `F` by `run`. */ + * The list of transformer functions, to be composed and lifted into `F` by `run`. + */ private[cats] val ks: List[Any => Any] /** - * The list of transformer functions composed into a single function, to be lifted into `F` by `run`. */ + * The list of transformer functions composed into a single function, to be lifted into `F` by `run`. + */ final def k: Pivot => A = Function.chain(ks.reverse)(_).asInstanceOf[A] import Coyoneda.{unsafeApply, Aux} /** - * Converts to `F[A]` given that `F` is a functor */ + * Converts to `F[A]` given that `F` is a functor + */ final def run(implicit F: Functor[F]): F[A] = F.map(fi)(k) /** - * Converts to `G[A]` given that `G` is a functor */ + * Converts to `G[A]` given that `G` is a functor + */ final def foldMap[G[_]](trans: F ~> G)(implicit G: Functor[G]): G[A] = G.map(trans(fi))(k) /** - * Converts to `Yoneda[F,A]` given that `F` is a functor */ + * Converts to `Yoneda[F,A]` given that `F` is a functor + */ final def toYoneda(implicit F: Functor[F]): Yoneda[F, A] = new Yoneda[F, A] { def apply[B](f: A => B): F[B] = F.map(fi)(k.andThen(f)) @@ -74,11 +81,13 @@ object Coyoneda { type Aux[F[_], A, B] = Coyoneda[F, A] { type Pivot = B } /** - * `F[A]` converts to `Coyoneda[F,A]` for any `F` */ + * `F[A]` converts to `Coyoneda[F,A]` for any `F` + */ def lift[F[_], A](fa: F[A]): Coyoneda[F, A] = apply(fa)(identity[A]) /** - * Like `lift(fa).map(k0)`. */ + * Like `lift(fa).map(k0)`. + */ def apply[F[_], A, B](fa: F[A])(k0: A => B): Aux[F, B, A] = unsafeApply(fa)(k0.asInstanceOf[Any => Any] :: Nil) diff --git a/free/src/main/scala/cats/free/Free.scala b/free/src/main/scala/cats/free/Free.scala index 44d8d243dc..01300b6039 100644 --- a/free/src/main/scala/cats/free/Free.scala +++ b/free/src/main/scala/cats/free/Free.scala @@ -47,7 +47,8 @@ sealed abstract class Free[S[_], A] extends Product with Serializable { resume.fold(s, r) /** - * Takes one evaluation step in the Free monad, re-associating left-nested binds in the process. */ + * Takes one evaluation step in the Free monad, re-associating left-nested binds in the process. + */ @tailrec final def step: Free[S, A] = this match { @@ -203,11 +204,13 @@ object Free extends FreeInstances { final private[free] case class Pure[S[_], A](a: A) extends Free[S, A] /** - * Suspend the computation with the given suspension. */ + * Suspend the computation with the given suspension. + */ final private[free] case class Suspend[S[_], A](a: S[A]) extends Free[S, A] /** - * Call a subroutine and continue with the given function. */ + * Call a subroutine and continue with the given function. + */ final private[free] case class FlatMapped[S[_], B, C](c: Free[S, C], f: C => Free[S, B]) extends Free[S, B] /** diff --git a/free/src/main/scala/cats/free/FreeApplicative.scala b/free/src/main/scala/cats/free/FreeApplicative.scala index e2c9ee545a..1985099529 100644 --- a/free/src/main/scala/cats/free/FreeApplicative.scala +++ b/free/src/main/scala/cats/free/FreeApplicative.scala @@ -153,14 +153,16 @@ sealed abstract class FreeApplicative[F[_], A] extends Product with Serializable foldMap(f) /** - * Interpret this algebra into a Monoid. */ + * 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[B](fb: F[B]): Const[M, B] = Const(f(fb)) } ).getConst /** - * Compile this FreeApplicative algebra into a Free algebra. */ + * Compile this FreeApplicative algebra into a Free algebra. + */ final def monad: Free[F, A] = foldMap[Free[F, *]] { new FunctionK[F, Free[F, *]] { def apply[B](fb: F[B]): Free[F, B] = Free.liftF(fb) } diff --git a/free/src/main/scala/cats/free/FreeInvariantMonoidal.scala b/free/src/main/scala/cats/free/FreeInvariantMonoidal.scala index e79529c6ee..53f56231b3 100644 --- a/free/src/main/scala/cats/free/FreeInvariantMonoidal.scala +++ b/free/src/main/scala/cats/free/FreeInvariantMonoidal.scala @@ -17,25 +17,29 @@ sealed abstract class FreeInvariantMonoidal[F[_], A] extends Product with Serial Zip(this, fb) /** - * Interprets/Runs the sequence of operations using the semantics of `InvariantMonoidal[G]` */ + * Interprets/Runs the sequence of operations using the semantics of `InvariantMonoidal[G]` + */ def foldMap[G[_]](nt: FunctionK[F, G])(implicit im: InvariantMonoidal[G]): G[A] // Note that implementing a concrete `foldMap` here does not work because // `Zip extends G[(A, B)]` confuses the type inferance when pattern matching on `this`. /** - * Interpret/run the operations using the semantics of `InvariantMonoidal[F]`. */ + * Interpret/run the operations using the semantics of `InvariantMonoidal[F]`. + */ final def fold(implicit F: InvariantMonoidal[F]): F[A] = foldMap(FunctionK.id[F]) /** - * Interpret this algebra into another InvariantMonoidal */ + * 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[B](fb: F[B]): FA[G, B] = lift(f(fb)) } } /** - * Interpret this algebra into a Monoid */ + * 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[B](fb: F[B]): Const[M, B] = Const(f(fb)) } @@ -72,7 +76,8 @@ object FreeInvariantMonoidal { Suspend(fa) /** - * `FreeInvariantMonoidal[S, *]` has a FreeInvariantMonoidal for any type constructor `S[_]`. */ + * `FreeInvariantMonoidal[S, *]` has a FreeInvariantMonoidal for any type constructor `S[_]`. + */ implicit def catsFreeInvariantMonoidal[S[_]]: InvariantMonoidal[FA[S, *]] = new InvariantMonoidal[FA[S, *]] { def unit: FA[S, Unit] = FreeInvariantMonoidal.pure(()) diff --git a/free/src/main/scala/cats/free/FreeT.scala b/free/src/main/scala/cats/free/FreeT.scala index 0697aad9ae..f4bdea1129 100644 --- a/free/src/main/scala/cats/free/FreeT.scala +++ b/free/src/main/scala/cats/free/FreeT.scala @@ -46,7 +46,8 @@ sealed abstract class FreeT[S[_], M[_], A] extends Product with Serializable { } /** - * Binds the given continuation to the result of this computation. */ + * Binds the given continuation to the result of this computation. + */ final def flatMap[B](f: A => FreeT[S, M, B]): FreeT[S, M, B] = FlatMapped(this, f) @@ -61,7 +62,8 @@ sealed abstract class FreeT[S[_], M[_], A] extends Product with Serializable { private[free] def interpret[T[_]](st: FunctionK[S, T])(implicit M: Functor[M]): FreeT[T, M, A] = compile(st) /** - * Change the base functor `S` for a `FreeT` action. */ + * Change the base functor `S` for a `FreeT` action. + */ def compile[T[_]](st: FunctionK[S, T])(implicit M: Functor[M]): FreeT[T, M, A] = step match { case e @ FlatMapped(_, _) => @@ -97,7 +99,8 @@ sealed abstract class FreeT[S[_], M[_], A] extends Product with Serializable { } /** - * Evaluates a single layer of the free monad */ + * Evaluates a single layer of the free monad + */ def resume(implicit S: Functor[S], M: Monad[M]): M[Either[S[FreeT[S, M, A]], A]] = { def go(ft: FreeT[S, M, A]): M[Either[FreeT[S, M, A], Either[S[FreeT[S, M, A]], A]]] = ft match { @@ -169,11 +172,13 @@ sealed abstract class FreeT[S[_], M[_], A] extends Product with Serializable { object FreeT extends FreeTInstances { /** - * Suspend the computation with the given suspension. */ + * Suspend the computation with the given suspension. + */ private[free] case class Suspend[S[_], M[_], A](a: M[Either[S[A], A]]) extends FreeT[S, M, A] /** - * Call a subroutine and continue with the given function. */ + * Call a subroutine and continue with the given function. + */ private[free] case class FlatMapped[S[_], M[_], A0, B](a0: FreeT[S, M, A0], f0: A0 => FreeT[S, M, B]) extends FreeT[S, M, B] { type A = A0 @@ -182,7 +187,8 @@ object FreeT extends FreeTInstances { } /** - * Return the given value in the free monad. */ + * Return the given value in the free monad. + */ def pure[S[_], M[_], A](value: A)(implicit M: Applicative[M]): FreeT[S, M, A] = Suspend(M.pure(Right(value))) @deprecated("Use FreeT.defer.", "1.0.0-MF") @@ -205,7 +211,8 @@ object FreeT extends FreeTInstances { Suspend(M.map(value)(Right(_))) /** - * Suspends a value within a functor in a single step. Monadic unit for a higher-order monad. */ + * Suspends a value within a functor in a single step. Monadic unit for a higher-order monad. + */ def liftF[S[_], M[_], A](value: S[A])(implicit M: Applicative[M]): FreeT[S, M, A] = Suspend(M.pure(Left(value))) diff --git a/free/src/main/scala/cats/free/package.scala b/free/src/main/scala/cats/free/package.scala index 075c9ae188..fae8025e0b 100644 --- a/free/src/main/scala/cats/free/package.scala +++ b/free/src/main/scala/cats/free/package.scala @@ -3,7 +3,8 @@ package cats package object free { /** - * Alias for the free monad over the `Function0` functor. */ + * Alias for the free monad over the `Function0` functor. + */ type Trampoline[A] = Free[Function0, A] object Trampoline extends TrampolineFunctions } diff --git a/kernel-laws/shared/src/main/scala/cats/kernel/laws/IsEq.scala b/kernel-laws/shared/src/main/scala/cats/kernel/laws/IsEq.scala index 654ddabffc..42d9031239 100644 --- a/kernel-laws/shared/src/main/scala/cats/kernel/laws/IsEq.scala +++ b/kernel-laws/shared/src/main/scala/cats/kernel/laws/IsEq.scala @@ -2,5 +2,6 @@ package cats.kernel package laws /** - * Represents two values of the same type that are expected to be equal. */ + * Represents two values of the same type that are expected to be equal. + */ final case class IsEq[A](lhs: A, rhs: A) diff --git a/kernel/src/main/scala-2.13+/cats/kernel/compat/HashCompat.scala b/kernel/src/main/scala-2.13+/cats/kernel/compat/HashCompat.scala index f338b939cf..d7916ac789 100644 --- a/kernel/src/main/scala-2.13+/cats/kernel/compat/HashCompat.scala +++ b/kernel/src/main/scala-2.13+/cats/kernel/compat/HashCompat.scala @@ -102,7 +102,8 @@ private[kernel] class HashCompat { // adapted from scala.util.hashing.MurmurHash3 /** - * Force all bits of the hash to avalanche. Used for finalizing the hash. */ + * Force all bits of the hash to avalanche. Used for finalizing the hash. + */ final protected def avalanche(hash: Int): Int = { var h = hash diff --git a/kernel/src/main/scala/cats/kernel/Comparison.scala b/kernel/src/main/scala/cats/kernel/Comparison.scala index 13f02c667a..0d08af9742 100644 --- a/kernel/src/main/scala/cats/kernel/Comparison.scala +++ b/kernel/src/main/scala/cats/kernel/Comparison.scala @@ -1,7 +1,8 @@ package cats.kernel /** - * ADT encoding the possible results of a comparison */ + * ADT encoding the possible results of a comparison + */ sealed abstract class Comparison(val toInt: Int, val toDouble: Double) extends Product with Serializable object Comparison { diff --git a/kernel/src/main/scala/cats/kernel/Hash.scala b/kernel/src/main/scala/cats/kernel/Hash.scala index 3cbe10e3e1..87b2917e38 100644 --- a/kernel/src/main/scala/cats/kernel/Hash.scala +++ b/kernel/src/main/scala/cats/kernel/Hash.scala @@ -29,7 +29,8 @@ abstract class HashFunctions[H[T] <: Hash[T]] extends EqFunctions[H] { object Hash extends HashFunctions[Hash] { /** - * Fetch a `Hash` instance given the specific type. */ + * Fetch a `Hash` instance given the specific type. + */ @inline final def apply[A](implicit ev: Hash[A]): Hash[A] = ev def by[@sp A, @sp B](f: A => B)(implicit ev: Hash[B]): Hash[A] = diff --git a/laws/src/main/scala/cats/laws/StrongLaws.scala b/laws/src/main/scala/cats/laws/StrongLaws.scala index 4f01499b03..e2fe31a326 100644 --- a/laws/src/main/scala/cats/laws/StrongLaws.scala +++ b/laws/src/main/scala/cats/laws/StrongLaws.scala @@ -17,22 +17,26 @@ trait StrongLaws[F[_, _]] extends ProfunctorLaws[F] { private def swapTuple[X, Y]: Tuple2[X, Y] => Tuple2[Y, X] = _.swap /** - * first' == dimap swap swap . second' */ + * first' == dimap swap swap . second' + */ def firstIsSwappedSecond[A, B, C](fab: F[A, B]): IsEq[F[(A, C), (B, C)]] = fab.first[C] <-> fab.second[C].dimap(swapTuple[A, C])(swapTuple[C, B]) /** - * second' == dimap swap swap . first' */ + * second' == dimap swap swap . first' + */ def secondIsSwappedFirst[A, B, C](fab: F[A, B]): IsEq[F[(C, A), (C, B)]] = fab.second[C] <-> fab.first[C].dimap(swapTuple[C, A])(swapTuple[B, C]) /** - * lmap fst == rmap fst . first' */ + * lmap fst == rmap fst . first' + */ def lmapEqualsFirstAndThenRmap[A, B, C](fab: F[A, B]): IsEq[F[(A, C), B]] = fab.lmap[(A, C)]({ case (a, _) => a }) <-> fab.first[C].rmap[B](_._1) /** - * lmap snd == rmap snd . second' */ + * lmap snd == rmap snd . second' + */ def lmapEqualsSecondAndThenRmap[A, B, C](fab: F[A, B]): IsEq[F[(C, A), B]] = fab.lmap[(C, A)]({ case (_, b) => b }) <-> fab.second[C].rmap[B](_._2) @@ -40,12 +44,14 @@ trait StrongLaws[F[_, _]] extends ProfunctorLaws[F] { private def mapSecond[X, Y, Z](f: Y => Z)(cb: (X, Y)): (X, Z) = (cb._1, f(cb._2)) /** - * lmap (second f) . first == rmap (second f) . first */ + * lmap (second f) . first == rmap (second f) . first + */ def dinaturalityFirst[A, B, C, D](fab: F[A, B], f: C => D): IsEq[F[(A, C), (B, D)]] = fab.first[C].rmap(mapSecond(f)) <-> fab.first[D].lmap(mapSecond(f)) /** - * lmap (first f) . second == rmap (first f) . second */ + * lmap (first f) . second == rmap (first f) . second + */ def dinaturalitySecond[A, B, C, D](fab: F[A, B], f: C => D): IsEq[F[(C, A), (D, B)]] = fab.second[C].rmap(mapFirst(f)) <-> fab.second[D].lmap(mapFirst(f)) diff --git a/laws/src/main/scala/cats/laws/discipline/Eq.scala b/laws/src/main/scala/cats/laws/discipline/Eq.scala index 30cb024611..4ae4f4a44d 100644 --- a/laws/src/main/scala/cats/laws/discipline/Eq.scala +++ b/laws/src/main/scala/cats/laws/discipline/Eq.scala @@ -157,12 +157,14 @@ object eq { Eq.by((_: (A, B) => C).tupled)(catsLawsEqForFn1) /** - * `Eq[AndThen]` instance, built by piggybacking on [[catsLawsEqForFn1]]. */ + * `Eq[AndThen]` instance, built by piggybacking on [[catsLawsEqForFn1]]. + */ implicit def catsLawsEqForAndThen[A, B](implicit A: Arbitrary[A], B: Eq[B]): Eq[AndThen[A, B]] = Eq.instance(catsLawsEqForFn1[A, B].eqv(_, _)) /** - * Create an approximation of Eq[Show[A]] by using catsLawsEqForFn1[A, String] */ + * Create an approximation of Eq[Show[A]] by using catsLawsEqForFn1[A, String] + */ implicit def catsLawsEqForShow[A: Arbitrary]: Eq[Show[A]] = Eq.by[Show[A], A => String] { showInstance => (a: A) => showInstance.show(a) diff --git a/project/Boilerplate.scala b/project/Boilerplate.scala index 4644f6dd04..338789542d 100644 --- a/project/Boilerplate.scala +++ b/project/Boilerplate.scala @@ -34,7 +34,8 @@ object Boilerplate { val header = "// auto-generated boilerplate by /project/Boilerplate.scala" // TODO: put something meaningful here? /** - * Returns a seq of the generated files. As a side-effect, it actually generates them... */ + * Returns a seq of the generated files. As a side-effect, it actually generates them... + */ def gen(dir: File) = for (t <- templates) yield { val tgtFile = t.filename(dir) diff --git a/testkit/src/main/scala/cats/tests/ListWrapper.scala b/testkit/src/main/scala/cats/tests/ListWrapper.scala index 8c8daa489a..27b201259c 100644 --- a/testkit/src/main/scala/cats/tests/ListWrapper.scala +++ b/testkit/src/main/scala/cats/tests/ListWrapper.scala @@ -132,7 +132,8 @@ object ListWrapper { val applicative: Applicative[ListWrapper] = alternative /** - * apply is taken due to ListWrapper being a case class */ + * apply is taken due to ListWrapper being a case class + */ val applyInstance: Apply[ListWrapper] = alternative def monoidK: MonoidK[ListWrapper] = alternative diff --git a/tests/src/test/scala/cats/tests/BinCodecInvariantMonoidalSuite.scala b/tests/src/test/scala/cats/tests/BinCodecInvariantMonoidalSuite.scala index 3d2b73a68a..f5bc3ed039 100644 --- a/tests/src/test/scala/cats/tests/BinCodecInvariantMonoidalSuite.scala +++ b/tests/src/test/scala/cats/tests/BinCodecInvariantMonoidalSuite.scala @@ -60,7 +60,8 @@ object BinCodecInvariantMonoidalSuite { } /** - * A small amount of binary bits */ + * A small amount of binary bits + */ type Bin = MiniList[Boolean] /** @@ -73,11 +74,13 @@ object BinCodecInvariantMonoidalSuite { trait BinCodec[A] extends Serializable { self => /** - * Reads the first value of a Bin, returning an optional value of type `A` and the remaining Bin. */ + * Reads the first value of a Bin, returning an optional value of type `A` and the remaining Bin. + */ def read(s: Bin): (Option[A], Bin) /** - * Writes a value of type `A` to Bin format. */ + * Writes a value of type `A` to Bin format. + */ def write(a: A): Bin } From de0ff10d12fe06e05dac79d020466c3e749bf940 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Wed, 17 Jun 2020 15:03:00 -0500 Subject: [PATCH 6/6] Update Simulacrum Scalafix --- build.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 3917d09b8c..0c967c6a56 100644 --- a/build.sbt +++ b/build.sbt @@ -12,7 +12,7 @@ lazy val scoverageSettings = Seq( ) organization in ThisBuild := "org.typelevel" -scalafixDependencies in ThisBuild += "org.typelevel" %% "simulacrum-scalafix" % "0.3.0" +scalafixDependencies in ThisBuild += "org.typelevel" %% "simulacrum-scalafix" % "0.4.0" val isTravisBuild = settingKey[Boolean]("Flag indicating whether the current build is running under Travis") val crossScalaVersionsFromTravis = settingKey[Seq[String]]("Scala versions set in .travis.yml as scala_version_XXX") @@ -80,7 +80,7 @@ lazy val catsSettings = Seq( lazy val simulacrumSettings = Seq( addCompilerPlugin(scalafixSemanticdb), scalacOptions ++= Seq(s"-P:semanticdb:targetroot:${baseDirectory.value}/target/.semanticdb", "-Yrangepos"), - libraryDependencies += "org.typelevel" %% "simulacrum-scalafix-annotations" % "0.3.0", + libraryDependencies += "org.typelevel" %% "simulacrum-scalafix-annotations" % "0.4.0", pomPostProcess := { (node: xml.Node) => new RuleTransformer(new RewriteRule { override def transform(node: xml.Node): Seq[xml.Node] =