From b3d821e30c9a5c659d7cd81da02861a229b08f57 Mon Sep 17 00:00:00 2001 From: Lucas Satabin Date: Mon, 25 Sep 2023 23:12:14 +0200 Subject: [PATCH] Fix implicits for scala 3 --- finite-state/shared/src/main/scala/fs2/data/esp/Rhs.scala | 6 +++--- finite-state/shared/src/main/scala/fs2/data/esp/Tag.scala | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/finite-state/shared/src/main/scala/fs2/data/esp/Rhs.scala b/finite-state/shared/src/main/scala/fs2/data/esp/Rhs.scala index c0c8400ad..d7b426afa 100644 --- a/finite-state/shared/src/main/scala/fs2/data/esp/Rhs.scala +++ b/finite-state/shared/src/main/scala/fs2/data/esp/Rhs.scala @@ -60,11 +60,11 @@ object Rhs { def epsilon[OutTag]: Rhs[OutTag] = Epsilon - implicit def show[O: Show]: Show[Rhs[O]] = _ match { + implicit def show[O: Show]: Show[Rhs[O]] = Show.show[Rhs[O]] { case Call(q, d, Nil) => show"q$q[$d]()" - case Call(q, d, params) => show"q$q[$d](${params.mkString_(", ")})" + case Call(q, d, params) => show"q$q[$d](${params.mkString_(", ")(show[O], implicitly)})" case SelfCall(q, Nil) => show"q$q[0](x0)" - case SelfCall(q, params) => show"q$q[0](x0, ${params.mkString_(", ")})" + case SelfCall(q, params) => show"q$q[0](x0, ${params.mkString_(", ")(show[O], implicitly)})" case Param(n) => show"y$n" case Tree(tag, inner) => show"<$tag> { $inner }" case CapturedTree(inner) => show"<%> { $inner }" diff --git a/finite-state/shared/src/main/scala/fs2/data/esp/Tag.scala b/finite-state/shared/src/main/scala/fs2/data/esp/Tag.scala index 9740e6a49..276f6ad00 100644 --- a/finite-state/shared/src/main/scala/fs2/data/esp/Tag.scala +++ b/finite-state/shared/src/main/scala/fs2/data/esp/Tag.scala @@ -68,14 +68,14 @@ object Tag { } implicit def order[T: Order]: Order[Tag[T]] = Order.from { - case (Name(n1), Name(n2)) => n1.compare(n2) + case (Name(n1), Name(n2)) => Order[T].compare(n1, n2) case (Name(_), _) => -1 case (Open, Name(_)) => 1 case (Open, _) => -1 case (Close, Name(_) | Open) => 1 case (Close, _) => -1 case (Value(_), Name(_) | Open | Close) => 1 - case (Value(v1), Value(v2)) => v1.compare(v2) + case (Value(v1), Value(v2)) => Order[T].compare(v1, v2) case (Value(_), Leaf) => -1 case (Leaf, Value(_) | Name(_) | Open | Close) => 1 case (Leaf, _) => -1