mirror of https://github.com/sbt/sbt.git
Get rid of Fn1
This commit is contained in:
parent
c98449e272
commit
35c3542492
22
build.sbt
22
build.sbt
|
|
@ -143,6 +143,11 @@ val collectionProj = (project in file("internal") / "util-collection")
|
|||
mimaBinaryIssueFilters ++= Seq(
|
||||
// Added private[sbt] method to capture State attributes.
|
||||
exclude[ReversedMissingMethodProblem]("sbt.internal.util.AttributeMap.setCond"),
|
||||
|
||||
// Dropped in favour of plain scala.Function, and its compose method
|
||||
exclude[MissingClassProblem]("sbt.internal.util.Fn1"),
|
||||
exclude[DirectMissingMethodProblem]("sbt.internal.util.TypeFunctions.toFn1"),
|
||||
exclude[DirectMissingMethodProblem]("sbt.internal.util.Types.toFn1"),
|
||||
),
|
||||
)
|
||||
.configure(addSbtUtilPosition)
|
||||
|
|
@ -418,7 +423,14 @@ lazy val sbtProj = (project in file("sbt"))
|
|||
crossScalaVersions := Seq(baseScalaVersion),
|
||||
crossPaths := false,
|
||||
mimaSettings,
|
||||
mimaBinaryIssueFilters ++= sbtIgnoredProblems,
|
||||
mimaBinaryIssueFilters ++= Vector(
|
||||
// Added more items to Import trait.
|
||||
exclude[ReversedMissingMethodProblem]("sbt.Import.sbt$Import$_setter_$WatchSource_="),
|
||||
exclude[ReversedMissingMethodProblem]("sbt.Import.WatchSource"),
|
||||
|
||||
// Dropped in favour of plain scala.Function, and its compose method
|
||||
exclude[DirectMissingMethodProblem]("sbt.package.toFn1"),
|
||||
)
|
||||
)
|
||||
.configure(addSbtCompilerBridge)
|
||||
|
||||
|
|
@ -461,14 +473,6 @@ lazy val vscodePlugin = (project in file("vscode-sbt-scala"))
|
|||
}
|
||||
)
|
||||
|
||||
lazy val sbtIgnoredProblems = {
|
||||
Seq(
|
||||
// Added more items to Import trait.
|
||||
exclude[ReversedMissingMethodProblem]("sbt.Import.sbt$Import$_setter_$WatchSource_="),
|
||||
exclude[ReversedMissingMethodProblem]("sbt.Import.WatchSource")
|
||||
)
|
||||
}
|
||||
|
||||
def scriptedTask: Def.Initialize[InputTask[Unit]] = Def.inputTask {
|
||||
val result = scriptedSource(dir => (s: State) => Scripted.scriptedParser(dir)).parsed
|
||||
// publishLocalBinAll.value // TODO: Restore scripted needing only binary jars.
|
||||
|
|
|
|||
|
|
@ -29,10 +29,6 @@ trait TypeFunctions {
|
|||
def apply[T](mg: M[G[T]]): N[G[T]] = f(mg)
|
||||
} */
|
||||
|
||||
implicit def toFn1[A, B](f: A => B): Fn1[A, B] = new Fn1[A, B] {
|
||||
def ∙[C](g: C => A) = f compose g
|
||||
}
|
||||
|
||||
type Endo[T] = T => T
|
||||
type ~>|[A[_], B[_]] = A ~> Compose[Option, B]#Apply
|
||||
}
|
||||
|
|
@ -52,7 +48,3 @@ object ~> {
|
|||
val Id: Id ~> Id = new (Id ~> Id) { def apply[T](a: T): T = a }
|
||||
implicit def tcIdEquals: (Id ~> Id) = Id
|
||||
}
|
||||
|
||||
trait Fn1[A, B] {
|
||||
def ∙[C](g: C => A): C => B
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,7 +133,6 @@ trait Import {
|
|||
type FeedbackProvidedException = sbt.internal.util.FeedbackProvidedException
|
||||
type FilePosition = sbt.internal.util.FilePosition
|
||||
type FilterLogger = sbt.internal.util.FilterLogger
|
||||
type Fn1[A, B] = sbt.internal.util.Fn1[A, B]
|
||||
val FullLogger = sbt.internal.util.FullLogger
|
||||
type FullLogger = sbt.internal.util.FullLogger
|
||||
val FullReader = sbt.internal.util.FullReader
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ object Transform {
|
|||
case Pure(eval, _) => uniform(Nil)(_ => Right(eval()))
|
||||
case m: Mapped[t, k] => toNode[t, k](m.in)(right ∙ m.f)(m.alist)
|
||||
case m: FlatMapped[t, k] => toNode[t, k](m.in)(left ∙ m.f)(m.alist)
|
||||
case DependsOn(in, deps) => uniform(existToAny(deps))(const(Left(in)) ∙ all)
|
||||
case DependsOn(in, deps) => uniform(existToAny(deps))(const(Left(in)) compose all)
|
||||
case Join(in, f) => uniform(in)(f)
|
||||
}
|
||||
def inline[T](t: Task[T]) = t.work match {
|
||||
|
|
|
|||
Loading…
Reference in New Issue