Skip to content

Commit 4de44e3

Browse files
oderskybishabosha
andauthored
Update tests/run/i7788.scala
Co-Authored-By: Jamie Thompson <[email protected]>
1 parent dfb6996 commit 4de44e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/run/i7788.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ given Show[String] = x => x
55
given Show[Int] = _.toString
66

77
given showEither[A,B]: (sA: Show[A]) => Show[B] => Show[Either[A,B]] =
8-
_.fold(a => s"Left(${summon[Show[A]].show(a)})", _ => "Right(Ignored value of B)")
8+
_.fold(a => s"Left(${summon[Show[A]].show(a)})", b => s"Right(${summon[Show[B]].show(b)})")
99
given [A,B]: (sA: Show[A]) => (sB: Show[B]) => Show[(A,B)] = (a,b) => s"(${sA.show(a)}), ${sB.show(b)})"
1010

1111
@main def ShowDemo =
1212
println(summon[Show[(Int, String)]].show(0 -> "hello"))
1313
println(summon[Show[Either[Int, String]]].show(Left(-1)))
14-
println(summon[Show[Either[Int, String]]].show(Right("success message")))
14+
println(summon[Show[Either[Int, String]]].show(Right("success message")))

0 commit comments

Comments
 (0)