Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move LowPriorityImplicits to a com.softwaremill.quicklens to avoid conflicts with other softwaremill libraries #238

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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("")
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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("")
}
}
Original file line number Diff line number Diff line change
@@ -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("")
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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("")
}
}
Loading