|
Scala example source code file (bounds.scala)
The Scala bounds.scala source code
trait Map[A, +C] {
def ++ [B1 >: C] (kvs: Iterable[Pair[A, B1]]): Map[A, B1] = this
def ++ [B1 >: C] (kvs: Iterator[Pair[A, B1]]): Map[A, B1] = this
}
class ListMap[A, +B] extends Map[A, B] {}
object ListMap {
def empty[X, Y] = new ListMap[X, Y]
def apply[A1, B2](elems: Pair[A1, B2]*): Map[A1, B2] = empty[A1,B2].++(elems.iterator)
}
Other Scala examples (source code examples)Here is a short list of links related to this Scala bounds.scala source code file: |
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.