Skip to content

Commit

Permalink
Reformat with scalafmt 3.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
scala-steward committed Feb 6, 2022
1 parent 21c4067 commit b869bdc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions project/TupleBifunctorInstancesBoiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ object GenTupleBifunctorInstances extends Template {
|
|private[cats] trait NTupleBifunctorInstances {
${if (arity > 1)
block"""
block"""
- implicit final def catsStdBifunctorForTuple$arity${`[A0, A(N - 2)]`}: Bifunctor[${`(A..N - 2, *, *)`}] =
- new Bifunctor[${`(A..N - 2, *, *)`}] {
- def bimap[A, B, C, D](fa: (${`A0, A(N - 2)`}A, B))(f: A => C, g: B => D): (${`A0, A(N - 2)`}C, D) = (${`fa._1..fa._(n - 2)`}f(fa._${arity - 1}), g(fa._$arity))
- }"""
else
block"""
else
block"""
-"""}
|}"""
}
Expand Down
6 changes: 3 additions & 3 deletions project/TupleBitraverseInstancesBoiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ object GenTupleBitraverseInstances extends Template {
|
|private[cats] trait NTupleBitraverseInstances {
${if (arity > 1)
block"""
block"""
- implicit final def catsStdBitraverseForTuple$arity${`[A0, A(N - 2)]`}: Bitraverse[${`(A..N - 2, *, *)`}] =
- new Bitraverse[${`(A..N - 2, *, *)`}] {
- def bitraverse[G[_], A, B, C, D](fa: (${`A0, A(N - 2)`}A, B))(f: A => G[C], g: B => G[D])(implicit G: Applicative[G]): G[(${`A0, A(N - 2)`}C, D)] =
Expand All @@ -29,8 +29,8 @@ ${if (arity > 1)
- def bifoldRight[A, B, C](fa: (${`A0, A(N - 2)`}A, B), c: Eval[C])(f: (A, Eval[C]) => Eval[C], g: (B, Eval[C]) => Eval[C]): Eval[C] =
- g(fa._$arity, f(fa._${arity - 1}, c))
- }"""
else
block"""
else
block"""
-"""}
|}"""
}
Expand Down
12 changes: 6 additions & 6 deletions project/TupleMonadInstancesBoiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,17 @@ object GenTupleMonadInstances extends Template {
|}
|private[cats] sealed trait NTupleMonadInstances1 extends NTupleMonadInstances2 {
- implicit final def catsStdCommutativeMonadForTuple$arity${`[A0, A(N - 1)]`}${`constraints A..(N-1)`(
"CommutativeMonoid"
)}
"CommutativeMonoid"
)}
- : CommutativeMonad[${`(A..N - 1, *)`}] =
- new FlatMapTuple$arity${`[A0, A(N - 1)]`}(${`A0, A(N - 1)`}) with CommutativeMonad[${`(A..N - 1, *)`}] {
- def pure[A](a: A): ${`A0, A(N - 1)&`("A")} = $monadPureMethod
- }
|}
|private[cats] sealed trait NTupleMonadInstances2 extends NTupleMonadInstances3 {
- implicit final def catsStdCommutativeFlatMapForTuple$arity${`[A0, A(N - 1)]`}${`constraints A..(N-1)`(
"CommutativeSemigroup"
)}
"CommutativeSemigroup"
)}
- : CommutativeFlatMap[${`(A..N - 1, *)`}] =
- new FlatMapTuple$arity${`[A0, A(N - 1)]`}(${`A0, A(N - 1)`}) with CommutativeFlatMap[${`(A..N - 1, *)`}]
|}
Expand Down Expand Up @@ -123,7 +123,7 @@ object GenTupleMonadInstances extends Template {
- val xb = f(fa._$arity)
- ${`combine A..(N - 1)`("fa", "xb", s"xb._$arity")}
"""
else block"""
else block"""
- f(fa._1)
"""}
- }
Expand All @@ -149,7 +149,7 @@ object GenTupleMonadInstances extends Template {
- case (${`a0, a(n - 1)`}, Right(b)) => (${`a0, a(n - 1)`}, b)
- case (${`a0, a(n - 1)`}, Left(nextA)) => loop((${`a0, a(n - 1)`}), nextA)
"""
else block"""
else block"""
- def loop(aa: A): Tuple1[B] =
- f(aa) match {
- case Tuple1(Right(b)) => Tuple1(b)
Expand Down
6 changes: 3 additions & 3 deletions tests/src/test/scala/cats/tests/TupleSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ class TupleSuite extends CatsSuite {
assert((foo1, bar1).show === s"(${Show[Foo].show(foo1)},${Show[Bar].show(bar1)})")
assert((foo1, bar1, baz1).show === s"(${Show[Foo].show(foo1)},${Show[Bar].show(bar1)},${Show[Baz].show(baz1)})")
assert((foo1, bar1, baz1, foo2, bar2, baz2).show === s"(${Show[Foo].show(foo1)},${Show[Bar].show(bar1)},${Show[Baz]
.show(baz1)},${Show[Foo].show(foo2)},${Show[Bar].show(bar2)},${Show[Baz].show(baz2)})")
.show(baz1)},${Show[Foo].show(foo2)},${Show[Bar].show(bar2)},${Show[Baz].show(baz2)})")
assert((foo1, bar1, baz1, foo2, bar2, baz2, foo3, bar3, baz3).show === s"(${Show[Foo].show(foo1)},${Show[Bar]
.show(bar1)},${Show[Baz].show(baz1)},${Show[Foo].show(foo2)},${Show[Bar].show(bar2)},${Show[Baz]
.show(baz2)},${Show[Foo].show(foo3)},${Show[Bar].show(bar3)},${Show[Baz].show(baz3)})")
.show(bar1)},${Show[Baz].show(baz1)},${Show[Foo].show(foo2)},${Show[Bar].show(bar2)},${Show[Baz]
.show(baz2)},${Show[Foo].show(foo3)},${Show[Bar].show(bar3)},${Show[Baz].show(baz3)})")
}
}

0 comments on commit b869bdc

Please sign in to comment.