Creates a new NonEmptySortedMap
with an additional element, unless the element is
already present.
Creates a new NonEmptySortedMap
with an additional element, unless the element is
already present.
the element to be added
a new map that contains all elements of this map and that also
contains elem
.
Creates a new NonEmptySortedMap
by adding all elements contained in another collection to this NonEmptySortedMap
, omitting duplicates.
Creates a new NonEmptySortedMap
by adding all elements contained in another collection to this NonEmptySortedMap
, omitting duplicates.
This method takes a collection of elements and adds all elements, omitting duplicates, into NonEmptySortedMap
.
Example:
scala> val a = NonEmptySortedMap(1, 2) ++ NonEmptySortedMap(2, "a") a: zio.prelude.NonEmptySortedMap[Any] = NonEmptySortedMap(1, 2, a)
the collection containing the elements to add.
a new NonEmptySortedMap
with the given elements added, omitting duplicates.
Adds the elem
to this NonEmptySortedMap
.
Adds the elem
to this NonEmptySortedMap
. Alias for +
.
Produces a new non empty map where values mapped according to function f.
Returns an element of this NonEmptySortedMap
and the remainder, which is a (possibly empty) SortedMap
.
Returns an element of this NonEmptySortedMap
and the remainder, which is a (possibly empty) SortedMap
.
Returns an element of this NonEmptySortedMap
and the remainder or None
, if the remainder is empty.
Removes the elem
from this NonEmptySortedMap
.
Removes the elem
from this NonEmptySortedMap
. Alias for -
.
Returns the tail of this NonEmptySortedMap
if it exists or None
otherwise.
Converts this NonEmptySortedMap
to a SortedMap
.
A non-empty wrapper for the scala immutable map. Note - this does not attempt to implement all features of map but what the author considers to be the "normal ones".