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("") - } -}