SortedMapFunctions

class Object
trait Matchable
class Any

Value members

Concrete methods

final
def alter[K, A](m: SortedMap[K, A], k: K)(f: Option[A] => Option[A]): SortedMap[K, A]

Vary the value of m get k.

Vary the value of m get k.

final
def getOrAdd[F[_], K, A](m: SortedMap[K, A], k: K)(fa: => F[A])(implicit F: Applicative[F]): F[(SortedMap[K, A], A)]

Grab a value out of SortedMap if it's present. Otherwise evaluate a value to be placed at that key in the SortedMap.

Grab a value out of SortedMap if it's present. Otherwise evaluate a value to be placed at that key in the SortedMap.

final
def insertWith[K, A](m1: SortedMap[K, A], k: K, v: A)(f: (A, A) => A): SortedMap[K, A]

As with SortedMap.updated, but resolve a collision with f. The first argument is guaranteed to be from m1.

As with SortedMap.updated, but resolve a collision with f. The first argument is guaranteed to be from m1.

final
def intersectWith[K : Ordering, A, B, C](m1: SortedMap[K, A], m2: SortedMap[K, B])(f: (A, B) => C): SortedMap[K, C]

Collect only elements with matching keys, joining their associated values with f.

Collect only elements with matching keys, joining their associated values with f.

final
def intersectWithKey[K : Ordering, A, B, C](m1: SortedMap[K, A], m2: SortedMap[K, B])(f: (K, A, B) => C): SortedMap[K, C]

Like intersectWith, but tell f about the key.

Like intersectWith, but tell f about the key.

final
def mapKeys[K, K2 : Ordering, A](m: SortedMap[K, A])(f: K => K2): SortedMap[K2, A]

Exchange keys of m according to f. Result may be smaller if f maps two or more Ks to the same K2, in which case the resulting associated value is an arbitrary choice.

Exchange keys of m according to f. Result may be smaller if f maps two or more Ks to the same K2, in which case the resulting associated value is an arbitrary choice.

final
def unionWith[K : Ordering, A](m1: SortedMap[K, A], m2: SortedMap[K, A])(f: (A, A) => A): SortedMap[K, A]

Union, resolving collisions with f, where the first arg is guaranteed to be from m1, the second from m2.

Union, resolving collisions with f, where the first arg is guaranteed to be from m1, the second from m2.

Note

iff f gives rise to a scalaz.Semigroup, so does unionWith(_, _)(f).

final
def unionWithKey[K : Ordering, A](m1: SortedMap[K, A], m2: SortedMap[K, A])(f: (K, A, A) => A): SortedMap[K, A]

Like unionWith, but telling f about the key.

Like unionWith, but telling f about the key.