mirror of https://github.com/sbt/sbt.git
Append instances for Set and Map
This commit is contained in:
parent
d82757f595
commit
26ec82ed73
|
|
@ -38,4 +38,12 @@ object Append
|
|||
def appendValues(a: Classpath, b: Seq[File]): Classpath = a ++ Attributed.blankSeq(b)
|
||||
def appendValue(a: Classpath, b: File): Classpath = a :+ Attributed.blank(b)
|
||||
}
|
||||
implicit def appendSet[T, V <: T]: Sequence[Set[T], Set[V], V] = new Sequence[Set[T], Set[V], V] {
|
||||
def appendValues(a: Set[T], b: Set[V]): Set[T] = a ++ b
|
||||
def appendValue(a: Set[T], b: V): Set[T] = a + b
|
||||
}
|
||||
implicit def appendMap[A,B, X <: A, Y <: B]: Sequence[Map[A,B], Map[X,Y], (X,Y)] = new Sequence[Map[A,B], Map[X,Y], (X,Y)] {
|
||||
def appendValues(a: Map[A,B], b: Map[X,Y]): Map[A,B] = a ++ b
|
||||
def appendValue(a: Map[A,B], b: (X,Y)): Map[A,B] = a + b
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue