Get rid of Fn1

This commit is contained in:
Dale Wijnand 2017-10-19 22:18:43 -05:00
parent c98449e272
commit 35c3542492
No known key found for this signature in database
GPG Key ID: 4F256E3D151DF5EF
4 changed files with 14 additions and 19 deletions

View File

@ -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.

View File

@ -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
}

View File

@ -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

View File

@ -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 {