Rewrite to inline syntax

This commit is contained in:
Dale Wijnand 2017-10-18 19:10:29 -05:00
parent c39e9af68c
commit fb17cc393f
No known key found for this signature in database
GPG Key ID: 4F256E3D151DF5EF
3 changed files with 6 additions and 4 deletions

View File

@ -145,6 +145,9 @@ val collectionProj = (project in file("internal") / "util-collection")
// Added private[sbt] method to capture State attributes.
exclude[ReversedMissingMethodProblem]("sbt.internal.util.AttributeMap.setCond"),
// Dropped in favour of kind-projector's inline type lambda syntax
exclude[MissingClassProblem]("sbt.internal.util.TypeFunctions$P1of2"),
// Dropped in favour of plain scala.Function, and its compose method
exclude[MissingClassProblem]("sbt.internal.util.Fn1"),
exclude[DirectMissingMethodProblem]("sbt.internal.util.TypeFunctions.toFn1"),

View File

@ -13,10 +13,9 @@ trait TypeFunctions {
sealed trait ConstK[A] { type l[L[x]] = A }
sealed trait Compose[A[_], B[_]] { type Apply[T] = A[B[T]] }
sealed trait [A[_], B[_]] { type l[T] = A[B[T]] }
sealed trait P1of2[M[_, _], A] { type Apply[B] = M[A, B]; type Flip[B] = M[B, A] }
final val left = new (Id ~> P1of2[Left, Nothing]#Flip) { def apply[T](t: T) = Left(t) }
final val right = new (Id ~> P1of2[Right, Nothing]#Apply) { def apply[T](t: T) = Right(t) }
final val left = new (Id ~> Left[?, Nothing]) { def apply[T](t: T) = Left(t) }
final val right = new (Id ~> Right[Nothing, ?]) { def apply[T](t: T) = Right(t) }
final val some = new (Id ~> Some) { def apply[T](t: T) = Some(t) }
final def idFun[T] = (t: T) => t
final def const[A, B](b: B): A => B = _ => b

View File

@ -54,7 +54,7 @@ private[sbt] final class Execute[A[_] <: AnyRef](
private[this] val reverse = idMap[A[_], Iterable[A[_]]]
private[this] val callers = pMap[A, Compose[IDSet, A]#Apply]
private[this] val state = idMap[A[_], State]
private[this] val viewCache = pMap[A, ({ type l[t] = Node[A, t] })#l]
private[this] val viewCache = pMap[A, Node[A, ?]]
private[this] val results = pMap[A, Result]
private[this] val getResult: A ~> Result = new (A ~> Result) {