From 6e814b7bed5fd0c2efc60208b40b2fd7e5e7eed0 Mon Sep 17 00:00:00 2001 From: Kacper Korban Date: Mon, 12 Aug 2024 18:15:01 +0200 Subject: [PATCH] Move LowPriorityImplicits to a com.softwaremill.quicklens to avoid conflicts with other softwaremill libraries --- .../LowPriorityImplicits.scala | 17 +++++++++++++++++ .../com.softwaremill.quicklens/package.scala | 17 ----------------- .../LowPriorityImplicits.scala | 16 ++++++++++++++++ .../com.softwaremill.quicklens/package.scala | 17 ----------------- 4 files changed, 33 insertions(+), 34 deletions(-) create mode 100644 quicklens/src/main/scala-2.13+/com.softwaremill.quicklens/LowPriorityImplicits.scala create mode 100644 quicklens/src/main/scala-2.13-/com.softwaremill.quicklens/LowPriorityImplicits.scala diff --git a/quicklens/src/main/scala-2.13+/com.softwaremill.quicklens/LowPriorityImplicits.scala b/quicklens/src/main/scala-2.13+/com.softwaremill.quicklens/LowPriorityImplicits.scala new file mode 100644 index 0000000..dccd6f8 --- /dev/null +++ b/quicklens/src/main/scala-2.13+/com.softwaremill.quicklens/LowPriorityImplicits.scala @@ -0,0 +1,17 @@ +package com.softwaremill.quicklens + +import scala.annotation.compileTimeOnly + +private[quicklens] trait LowPriorityImplicits { + + /** + * `QuicklensEach` is in `LowPriorityImplicits` to not conflict with the `QuicklensMapAtFunctor` on `each` calls. + */ + implicit class QuicklensEach[F[_], T](t: F[T])(implicit f: QuicklensFunctor[F, T]) { + @compileTimeOnly(canOnlyBeUsedInsideModify("each")) + def each: T = sys.error("") + + @compileTimeOnly(canOnlyBeUsedInsideModify("eachWhere")) + def eachWhere(p: T => Boolean): T = sys.error("") + } +} diff --git a/quicklens/src/main/scala-2.13+/com.softwaremill.quicklens/package.scala b/quicklens/src/main/scala-2.13+/com.softwaremill.quicklens/package.scala index 707bca5..3b1592d 100644 --- a/quicklens/src/main/scala-2.13+/com.softwaremill.quicklens/package.scala +++ b/quicklens/src/main/scala-2.13+/com.softwaremill.quicklens/package.scala @@ -1,7 +1,5 @@ package com.softwaremill -import com.softwaremill.quicklens.{QuicklensMapAtFunctor, canOnlyBeUsedInsideModify} - import scala.annotation.compileTimeOnly import scala.collection.Factory import scala.collection.SeqLike @@ -294,18 +292,3 @@ package object quicklens extends LowPriorityImplicits { override def eachRight(e: Either[L, R])(f: (R) => R) = e.map(f) } } - -sealed trait LowPriorityImplicits { - - import quicklens._ - - /** `QuicklensEach` is in `LowPriorityImplicits` to not conflict with the `QuicklensMapAtFunctor` on `each` calls. - */ - implicit class QuicklensEach[F[_], T](t: F[T])(implicit f: QuicklensFunctor[F, T]) { - @compileTimeOnly(canOnlyBeUsedInsideModify("each")) - def each: T = sys.error("") - - @compileTimeOnly(canOnlyBeUsedInsideModify("eachWhere")) - def eachWhere(p: T => Boolean): T = sys.error("") - } -} diff --git a/quicklens/src/main/scala-2.13-/com.softwaremill.quicklens/LowPriorityImplicits.scala b/quicklens/src/main/scala-2.13-/com.softwaremill.quicklens/LowPriorityImplicits.scala new file mode 100644 index 0000000..c14eac5 --- /dev/null +++ b/quicklens/src/main/scala-2.13-/com.softwaremill.quicklens/LowPriorityImplicits.scala @@ -0,0 +1,16 @@ +package com.softwaremill.quicklens + +import scala.annotation.compileTimeOnly + +private[quicklens] trait LowPriorityImplicits { + + /** `QuicklensEach` is in `LowPriorityImplicits` to not conflict with the `QuicklensMapAtFunctor` on `each` calls. + */ + implicit class QuicklensEach[F[_], T](t: F[T])(implicit f: QuicklensFunctor[F, T]) { + @compileTimeOnly(canOnlyBeUsedInsideModify("each")) + def each: T = sys.error("") + + @compileTimeOnly(canOnlyBeUsedInsideModify("eachWhere")) + def eachWhere(p: T => Boolean): T = sys.error("") + } +} diff --git a/quicklens/src/main/scala-2.13-/com.softwaremill.quicklens/package.scala b/quicklens/src/main/scala-2.13-/com.softwaremill.quicklens/package.scala index 51e95c9..65b449e 100644 --- a/quicklens/src/main/scala-2.13-/com.softwaremill.quicklens/package.scala +++ b/quicklens/src/main/scala-2.13-/com.softwaremill.quicklens/package.scala @@ -1,7 +1,5 @@ package com.softwaremill -import com.softwaremill.quicklens.{QuicklensMapAtFunctor, canOnlyBeUsedInsideModify} - import scala.annotation.compileTimeOnly import scala.collection.TraversableLike import scala.collection.SeqLike @@ -299,18 +297,3 @@ package object quicklens extends LowPriorityImplicits { override def eachRight(e: Either[L, R])(f: (R) => R) = e.right.map(f) } } - -sealed trait LowPriorityImplicits { - - import quicklens._ - - /** `QuicklensEach` is in `LowPriorityImplicits` to not conflict with the `QuicklensMapAtFunctor` on `each` calls. - */ - implicit class QuicklensEach[F[_], T](t: F[T])(implicit f: QuicklensFunctor[F, T]) { - @compileTimeOnly(canOnlyBeUsedInsideModify("each")) - def each: T = sys.error("") - - @compileTimeOnly(canOnlyBeUsedInsideModify("eachWhere")) - def eachWhere(p: T => Boolean): T = sys.error("") - } -}