mirror of https://github.com/sbt/sbt.git
Remove the unused ~>
This commit is contained in:
parent
10fc5da8b6
commit
7ac3cd321d
|
|
@ -10,7 +10,7 @@ package sbt
|
||||||
import sbt.internal.util.complete.Parser
|
import sbt.internal.util.complete.Parser
|
||||||
import Def.{ Initialize, ScopedKey }
|
import Def.{ Initialize, ScopedKey }
|
||||||
import std.TaskExtra._
|
import std.TaskExtra._
|
||||||
import sbt.internal.util.{ ~>, AttributeKey, Types }
|
import sbt.internal.util.{ AttributeKey, Types }
|
||||||
import sbt.internal.util.Types._
|
import sbt.internal.util.Types._
|
||||||
import sbt.internal.util.Util._
|
import sbt.internal.util.Util._
|
||||||
import sbt.util.Applicative
|
import sbt.util.Applicative
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ package sbt
|
||||||
import scala.annotation.targetName
|
import scala.annotation.targetName
|
||||||
|
|
||||||
import sbt.internal.util.Types.*
|
import sbt.internal.util.Types.*
|
||||||
import sbt.internal.util.{ ~>, AttributeKey, Settings, SourcePosition }
|
import sbt.internal.util.{ AttributeKey, Settings, SourcePosition }
|
||||||
import sbt.internal.util.TupleMapExtension.*
|
import sbt.internal.util.TupleMapExtension.*
|
||||||
import sbt.util.OptJsonWriter
|
import sbt.util.OptJsonWriter
|
||||||
import sbt.ConcurrentRestrictions.Tag
|
import sbt.ConcurrentRestrictions.Tag
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import sbt.internal.util.appmacro.{
|
||||||
// MonadInstance
|
// MonadInstance
|
||||||
}
|
}
|
||||||
// import Instance.Transform
|
// import Instance.Transform
|
||||||
import sbt.internal.util.{ LinePosition, NoPosition, SourcePosition, ~> }
|
import sbt.internal.util.{ LinePosition, NoPosition, SourcePosition }
|
||||||
|
|
||||||
import language.experimental.macros
|
import language.experimental.macros
|
||||||
import scala.annotation.tailrec
|
import scala.annotation.tailrec
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,8 @@ import sbt.internal.{
|
||||||
SettingCompletions,
|
SettingCompletions,
|
||||||
SessionSettings
|
SessionSettings
|
||||||
}
|
}
|
||||||
import sbt.internal.util.{ AttributeKey, AttributeMap, Dag, Relation, Settings, ~> }
|
import sbt.internal.util.{ AttributeKey, AttributeMap, Dag, Relation, Settings }
|
||||||
import sbt.internal.util.Types.const // , idFun }
|
import sbt.internal.util.Types.const
|
||||||
import sbt.internal.util.complete.DefaultParsers
|
import sbt.internal.util.complete.DefaultParsers
|
||||||
import sbt.internal.server.ServerHandler
|
import sbt.internal.server.ServerHandler
|
||||||
import sbt.librarymanagement.Configuration
|
import sbt.librarymanagement.Configuration
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import sbt.internal.inc.{ MappedFileConverter, ScalaInstance, ZincLmUtil, ZincUt
|
||||||
import sbt.internal.server.BuildServerEvalReporter
|
import sbt.internal.server.BuildServerEvalReporter
|
||||||
import sbt.internal.util.Attributed.data
|
import sbt.internal.util.Attributed.data
|
||||||
import sbt.internal.util.Types.const
|
import sbt.internal.util.Types.const
|
||||||
import sbt.internal.util.{ Attributed, Settings, ~> }
|
import sbt.internal.util.{ Attributed, Settings }
|
||||||
import sbt.io.{ GlobFilter, IO, Path }
|
import sbt.io.{ GlobFilter, IO, Path }
|
||||||
import sbt.librarymanagement.ivy.{ InlineIvyConfiguration, IvyDependencyResolution, IvyPaths }
|
import sbt.librarymanagement.ivy.{ InlineIvyConfiguration, IvyDependencyResolution, IvyPaths }
|
||||||
import sbt.librarymanagement.{ Configuration, Configurations, Resolver }
|
import sbt.librarymanagement.{ Configuration, Configurations, Resolver }
|
||||||
|
|
|
||||||
|
|
@ -206,7 +206,7 @@ trait Import {
|
||||||
type UnprintableException = sbt.internal.util.UnprintableException
|
type UnprintableException = sbt.internal.util.UnprintableException
|
||||||
val Util = sbt.internal.util.Util
|
val Util = sbt.internal.util.Util
|
||||||
// val ~> = sbt.internal.util.~>
|
// val ~> = sbt.internal.util.~>
|
||||||
type ~>[-K[_], +V[_]] = sbt.internal.util.~>[K, V]
|
// type ~>[-K[_], +V[_]] = sbt.internal.util.~>[K, V]
|
||||||
|
|
||||||
// sbt.internal.util.complete
|
// sbt.internal.util.complete
|
||||||
object complete {
|
object complete {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ package sbt
|
||||||
|
|
||||||
import sbt.internal.Action
|
import sbt.internal.Action
|
||||||
import sbt.internal.util.Types.const
|
import sbt.internal.util.Types.const
|
||||||
import sbt.internal.util.{ ~>, AttributeKey, AttributeMap }
|
import sbt.internal.util.{ AttributeKey, AttributeMap }
|
||||||
import ConcurrentRestrictions.{ Tag, TagMap, tagsKey }
|
import ConcurrentRestrictions.{ Tag, TagMap, tagsKey }
|
||||||
import sbt.util.Monad
|
import sbt.util.Monad
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ package sbt
|
||||||
package std
|
package std
|
||||||
|
|
||||||
import sbt.internal.Action
|
import sbt.internal.Action
|
||||||
import sbt.internal.util.{ ~>, DelegatingPMap, RMap }
|
import sbt.internal.util.{ DelegatingPMap, RMap }
|
||||||
import sbt.internal.util.TupleMapExtension.*
|
import sbt.internal.util.TupleMapExtension.*
|
||||||
import TaskExtra.{ all, existToAny }
|
import TaskExtra.{ all, existToAny }
|
||||||
import sbt.internal.util.Types.*
|
import sbt.internal.util.Types.*
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ package sbt
|
||||||
import java.util.concurrent.ExecutionException
|
import java.util.concurrent.ExecutionException
|
||||||
|
|
||||||
import sbt.internal.util.ErrorHandling.wideConvert
|
import sbt.internal.util.ErrorHandling.wideConvert
|
||||||
import sbt.internal.util.{ DelegatingPMap, IDSet, PMap, RMap, ~> }
|
import sbt.internal.util.{ DelegatingPMap, IDSet, PMap, RMap }
|
||||||
import sbt.internal.util.Types.const
|
import sbt.internal.util.Types.const
|
||||||
import sbt.internal.util.Util.nilSeq
|
import sbt.internal.util.Util.nilSeq
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,6 @@
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import sbt.internal.util.~>
|
|
||||||
|
|
||||||
// used instead of Either[Incomplete, T] for type inference
|
// used instead of Either[Incomplete, T] for type inference
|
||||||
|
|
||||||
/** Result of completely evaluating a task. */
|
/** Result of completely evaluating a task. */
|
||||||
|
|
|
||||||
|
|
@ -26,15 +26,14 @@ trait RMap[K[_], V[_]] {
|
||||||
sealed case class TPair[T](key: K[T], value: V[T])
|
sealed case class TPair[T](key: K[T], value: V[T])
|
||||||
}
|
}
|
||||||
|
|
||||||
trait IMap[K[_], V[_]] extends (K ~> V) with RMap[K, V] {
|
trait IMap[K[_], V[_]] extends RMap[K, V] {
|
||||||
def put[T](k: K[T], v: V[T]): IMap[K, V]
|
def put[T](k: K[T], v: V[T]): IMap[K, V]
|
||||||
def remove[T](k: K[T]): IMap[K, V]
|
def remove[T](k: K[T]): IMap[K, V]
|
||||||
def mapValue[T](k: K[T], init: V[T], f: V[T] => V[T]): IMap[K, V]
|
def mapValue[T](k: K[T], init: V[T], f: V[T] => V[T]): IMap[K, V]
|
||||||
def mapValues[V2[_]](f: [A] => V[A] => V2[A]): IMap[K, V2]
|
def mapValues[V2[_]](f: [A] => V[A] => V2[A]): IMap[K, V2]
|
||||||
def mapSeparate[VL[_], VR[_]](f: V ~> λ[T => Either[VL[T], VR[T]]]): (IMap[K, VL], IMap[K, VR])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trait PMap[K[_], V[_]] extends (K ~> V) with RMap[K, V] {
|
trait PMap[K[_], V[_]] extends RMap[K, V] {
|
||||||
def update[T](k: K[T], v: V[T]): Unit
|
def update[T](k: K[T], v: V[T]): Unit
|
||||||
def remove[T](k: K[T]): Option[V[T]]
|
def remove[T](k: K[T]): Option[V[T]]
|
||||||
def getOrUpdate[T](k: K[T], make: => V[T]): V[T]
|
def getOrUpdate[T](k: K[T], make: => V[T]): V[T]
|
||||||
|
|
@ -80,21 +79,6 @@ object IMap {
|
||||||
k -> f(v.asInstanceOf[V[Any]])
|
k -> f(v.asInstanceOf[V[Any]])
|
||||||
}.toArray: _*))
|
}.toArray: _*))
|
||||||
|
|
||||||
def mapSeparate[VL[_], VR[_]](f: V ~> λ[T => Either[VL[T], VR[T]]]) = {
|
|
||||||
val left = new java.util.concurrent.ConcurrentHashMap[K[Any], VL[Any]]
|
|
||||||
val right = new java.util.concurrent.ConcurrentHashMap[K[Any], VR[Any]]
|
|
||||||
Par(backing.toVector).foreach { case (k, v) =>
|
|
||||||
f(v.asInstanceOf[V[Any]]) match {
|
|
||||||
case Left(l) => left.put(k, l)
|
|
||||||
case Right(r) => right.put(k, r)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
(
|
|
||||||
new IMap0[K, VL](new WrappedMap(left.asInstanceOf)),
|
|
||||||
new IMap0[K, VR](new WrappedMap(right.asInstanceOf))
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
def toSeq = backing.toSeq.asInstanceOf[Seq[(K[Any], V[Any])]]
|
def toSeq = backing.toSeq.asInstanceOf[Seq[(K[Any], V[Any])]]
|
||||||
def keys = backing.keys.asInstanceOf[Iterable[K[Any]]]
|
def keys = backing.keys.asInstanceOf[Iterable[K[Any]]]
|
||||||
def values = backing.values.asInstanceOf[Iterable[V[Any]]]
|
def values = backing.values.asInstanceOf[Iterable[V[Any]]]
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ trait TypeFunctions:
|
||||||
type Id[X] = X
|
type Id[X] = X
|
||||||
type NothingK[X] = Nothing
|
type NothingK[X] = Nothing
|
||||||
|
|
||||||
sealed trait ∙[A[_], B[_]] { type l[T] = A[B[T]] }
|
|
||||||
private type AnyLeft[A] = Left[A, Nothing]
|
private type AnyLeft[A] = Left[A, Nothing]
|
||||||
private type AnyRight[A] = Right[Nothing, A]
|
private type AnyRight[A] = Right[Nothing, A]
|
||||||
final val left: [A] => A => AnyLeft[A] = [A] => (a: A) => Left(a)
|
final val left: [A] => A => AnyLeft[A] = [A] => (a: A) => Left(a)
|
||||||
|
|
@ -56,16 +55,6 @@ object TypeFunctions extends TypeFunctions:
|
||||||
end TypeFunctions
|
end TypeFunctions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
trait ~>[-F1[_], +F2[_]] { outer =>
|
|
||||||
def apply[A](f1: F1[A]): F2[A]
|
|
||||||
// directly on ~> because of type inference limitations
|
|
||||||
final def ∙[F3[_]](g: F3 ~> F1): F3 ~> F2 = new ~>[F3, F2] {
|
|
||||||
override def apply[A](f3: F3[A]) = outer.apply(g(f3))
|
|
||||||
}
|
|
||||||
final def ∙[C, D](g: C => D)(implicit ev: D <:< F1[D]): C => F2[D] = i => apply(ev(g(i)))
|
|
||||||
lazy val fn: [A] => F1[A] => F2[A] = [A] => (f1: F1[A]) => outer.apply[A](f1)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
object ~> {
|
object ~> {
|
||||||
import TypeFunctions._
|
import TypeFunctions._
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue