NonEmptyMapOps

cats.data.NonEmptyMapOps
sealed class NonEmptyMapOps[K, A](val value: Type[K, A])

Attributes

Source
NonEmptyMapImpl.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def ++(as: Type[K, A]): Type[K, A]

Alias for concat

Alias for concat

Attributes

Source
NonEmptyMapImpl.scala
def -(key: K): SortedMap[K, A]

Removes a key from this map, returning a new SortedMap.

Removes a key from this map, returning a new SortedMap.

Attributes

Source
NonEmptyMapImpl.scala
def ===(that: Type[K, A])(implicit A: Eq[A]): Boolean

Typesafe equality operator.

Typesafe equality operator.

This method is similar to == except that it only allows two NonEmptySet[A] values to be compared to each other, and uses equality provided by Eq[_] instances, rather than using the universal equality provided by .equals.

Attributes

Source
NonEmptyMapImpl.scala
def add(ka: (K, A)): Type[K, A]

Adds a key-value pair to this map, returning a new NonEmptyMap.

Adds a key-value pair to this map, returning a new NonEmptyMap.

Attributes

Source
NonEmptyMapImpl.scala
def apply(key: K): Option[A]

Alias for lookup

Alias for lookup

Attributes

Source
NonEmptyMapImpl.scala
def concat(as: Type[K, A]): Type[K, A]

Appends this NEM to another NEM, producing a new NonEmptyMap.

Appends this NEM to another NEM, producing a new NonEmptyMap.

Attributes

Source
NonEmptyMapImpl.scala
def contains(key: K): Boolean

Checks whether this map contains a binding for the given key.

Checks whether this map contains a binding for the given key.

Attributes

Source
NonEmptyMapImpl.scala
def exists(f: A => Boolean): Boolean

Tests whether a predicate holds for at least one element of this map.

Tests whether a predicate holds for at least one element of this map.

Attributes

Source
NonEmptyMapImpl.scala
def filter(p: A => Boolean): SortedMap[K, A]

Filters all elements of this map that do not satisfy the given predicate.

Filters all elements of this map that do not satisfy the given predicate.

Attributes

Source
NonEmptyMapImpl.scala
def filterNot(p: A => Boolean): SortedMap[K, A]

Filters all elements of this map that satisfy the given predicate.

Filters all elements of this map that satisfy the given predicate.

Attributes

Source
NonEmptyMapImpl.scala
def find(f: A => Boolean): Option[(K, A)]

Returns the first value along with its key, that matches the given predicate.

Returns the first value along with its key, that matches the given predicate.

Attributes

Source
NonEmptyMapImpl.scala
def foldLeft[B](b: B)(f: (B, A) => B): B

Left-associative fold using f.

Left-associative fold using f.

Attributes

Source
NonEmptyMapImpl.scala
def foldRight[B](lb: Eval[B])(f: (A, Eval[B]) => Eval[B]): Eval[B]

Right-associative fold using f.

Right-associative fold using f.

Attributes

Source
NonEmptyMapImpl.scala
def forall(p: A => Boolean): Boolean

Tests whether a predicate holds for all elements of this map.

Tests whether a predicate holds for all elements of this map.

Attributes

Source
NonEmptyMapImpl.scala
def head: (K, A)

Returns the first key-value pair of this map.

Returns the first key-value pair of this map.

Attributes

Source
NonEmptyMapImpl.scala
def keys: Type[K]

Returns a SortedSet containing all the keys of this map.

Returns a SortedSet containing all the keys of this map.

Attributes

Source
NonEmptyMapImpl.scala
def last: (K, A)

Returns the last key-value pair of this map.

Returns the last key-value pair of this map.

Attributes

Source
NonEmptyMapImpl.scala
def length: Int

Returns the amount of key-value pars in this map.

Returns the amount of key-value pars in this map.

Attributes

Source
NonEmptyMapImpl.scala
def lookup(k: K): Option[A]

Optionally returns the value associated with the given key.

Optionally returns the value associated with the given key.

Attributes

Source
NonEmptyMapImpl.scala
def map[B](f: A => B): Type[K, B]

Applies f to all the elements

Applies f to all the elements

Attributes

Source
NonEmptyMapImpl.scala
def mapBoth[L, B](f: (K, A) => (L, B))(implicit orderL: Order[L]): Type[L, B]

Applies f to both keys and elements simultaneously.

Applies f to both keys and elements simultaneously.

Attributes

Source
NonEmptyMapImpl.scala
def mapKeys[L](f: K => L)(implicit orderL: Order[L]): Type[L, A]

Applies f to all the keys leaving elements unchanged.

Applies f to all the keys leaving elements unchanged.

Attributes

Source
NonEmptyMapImpl.scala
def nonEmptyTraverse[G[_], B](f: A => G[B])(implicit G: Apply[G]): G[Type[K, B]]

Given a function which returns a G effect, thread this effect through the running of this function on all the values in this map, returning an NonEmptyMap[K, B] in a G context.

Given a function which returns a G effect, thread this effect through the running of this function on all the values in this map, returning an NonEmptyMap[K, B] in a G context.

Attributes

Source
NonEmptyMapImpl.scala
def reduce(implicit S: Semigroup[A]): A

Reduce using the Semigroup of A

Reduce using the Semigroup of A

Attributes

Source
NonEmptyMapImpl.scala
def reduceLeft(f: (A, A) => A): A

Left-associative reduce using f.

Left-associative reduce using f.

Attributes

Source
NonEmptyMapImpl.scala
def reduceLeftTo[B](f: A => B)(g: (B, A) => B): B

Apply f to the "initial element" of fa and combine it with every other value using the given function g.

Apply f to the "initial element" of fa and combine it with every other value using the given function g.

Attributes

Source
NonEmptyMapImpl.scala
def reduceRight(f: (A, Eval[A]) => Eval[A]): Eval[A]

Right-associative reduce using f.

Right-associative reduce using f.

Attributes

Source
NonEmptyMapImpl.scala
def reduceRightTo[B](f: A => B)(g: (A, Eval[B]) => Eval[B]): Eval[B]

Apply f to the "initial element" of this map and lazily combine it with every other value using the given function g.

Apply f to the "initial element" of this map and lazily combine it with every other value using the given function g.

Attributes

Source
NonEmptyMapImpl.scala
def show(implicit A: Show[A], K: Show[K]): String

Typesafe stringification method.

Typesafe stringification method.

This method is similar to .toString except that it stringifies values according to Show[_] instances, rather than using the universal .toString method.

Attributes

Source
NonEmptyMapImpl.scala
def tail: SortedMap[K, A]

Returns all the key-value pairs, except for the first.

Returns all the key-value pairs, except for the first.

Attributes

Source
NonEmptyMapImpl.scala
def toNel: NonEmptyList[(K, A)]

Returns a non empty list of map contents, similarly to Map#toList

Returns a non empty list of map contents, similarly to Map#toList

Attributes

Source
NonEmptyMapImpl.scala
def toSortedMap: SortedMap[K, A]

Converts this map to a SortedMap.

Converts this map to a SortedMap.

Attributes

Source
NonEmptyMapImpl.scala
def transform[B](f: (K, A) => B): Type[K, B]

Transforms the elements only by applying f to both elements and associated keys.

Transforms the elements only by applying f to both elements and associated keys.

Attributes

Source
NonEmptyMapImpl.scala
def updateWith(k: K)(f: A => A): Type[K, A]

Applies f to the value stored at k.

Applies f to the value stored at k. If lookup misses, does nothing.

Attributes

Source
NonEmptyMapImpl.scala

Concrete fields

val value: Type[K, A]

Attributes

Source
NonEmptyMapImpl.scala