Provide an AdditiveMonoid[Map[A, B]].
Provide an AdditiveMonoid[Map[A, B]].
The maps are combined key-by-key, using + to merge values if necessary.
Create a new literal map.
Create a new literal map.
Note that this method will box the given items. Unless you already have a sequence of tuples, another constructor may require fewer allocations.
Example: Map(1 -> "cat", 2 -> "dog", 3 -> "fish")
Create an empty Map.
Create an empty Map.
Example: Map.empty[Int, String]
Provide an Eq[Map[A, B]] instance.
Provide an Eq[Map[A, B]] instance.
Since Maps are so reliant on equality, and use hash codes internally, the default equality is used to compare elements.
Create a map from an array of keys and another array of values.
Create a map from an array of keys and another array of values.
Example: Map(Array(1,2,3), Array("cat", "dog", "fish"))
Create a map from an iterable of tuples.
Create a map from an iterable of tuples.
Note that this method will box the given items. Unless you already have a sequence of tuples, another constructor may require fewer allocations.
Example: Map.fromIterable(List((1, "cat"), (2, "dog"), (3, "fish")))
Provide a Monoid[Map[A, B]].
Provide a Monoid[Map[A, B]].
The maps are combined key-by-key, using |+| to merge values if necessary.
Provide an MultiplicativeMonoid[Map[A, B]].
Provide an MultiplicativeMonoid[Map[A, B]].
The maps are combined key-by-key, using * to merge values if necessary.
Create a Map that can hold n unique keys without resizing itself.
Create a Map that can hold n unique keys without resizing itself.
Note that the internal representation will allocate more space than requested to satisfy the requirements of internal alignment. Map uses arrays whose lengths are powers of two, and needs at least 33% of the map free to enable good hashing performance.
Example: Map.ofSize[Int, String](100).