Skip to content

Commit

Permalink
Merge pull request scala#9251 from seratch/issue-12065
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand committed Oct 22, 2020
2 parents 4b8eea0 + fff2b81 commit 6e96b92
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/library/scala/collection/Factory.scala
Expand Up @@ -383,14 +383,29 @@ trait SpecificIterableFactory[-A, +C] extends Factory[A, C] {
*/
trait MapFactory[+CC[_, _]] extends Serializable {

/**
* An empty Map
*/
def empty[K, V]: CC[K, V]

/**
* A collection of type Map generated from given iterable object.
*/
def from[K, V](it: IterableOnce[(K, V)]): CC[K, V]

/**
* A collection of type Map that contains given key/value bindings.
*/
def apply[K, V](elems: (K, V)*): CC[K, V] = from(elems)

/**
* The default builder for Map objects.
*/
def newBuilder[K, V]: Builder[(K, V), CC[K, V]]

/**
* The default Factory instance for maps.
*/
implicit def mapFactory[K, V]: Factory[(K, V), CC[K, V]] = MapFactory.toFactory(this)
}

Expand Down

0 comments on commit 6e96b92

Please sign in to comment.