NonEmptyMap

zio.prelude.NonEmptyMap
See theNonEmptyMap companion class
object NonEmptyMap

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply[K, V](elem: (K, V), others: Iterable[(K, V)]): NonEmptyMap[K, V]
def apply[K, V](elem: (K, V), others: (K, V)*): NonEmptyMap[K, V]

Creates a NonEmptyMap with the specified elements.

Creates a NonEmptyMap with the specified elements.

Type parameters

A

the type of the NonEmptyMap's elements

Value parameters

elem

an element of the created NonEmptyMap

others

the remaining elements of the created NonEmptyMap

Attributes

Returns

a new NonEmptyMap with elements elem and others

def fromIterable[K, V](head: (K, V), tail: Iterable[(K, V)]): NonEmptyMap[K, V]

Constructs a NonEmptyMap from an element and Iterable.

Constructs a NonEmptyMap from an element and Iterable.

Attributes

Constructs a NonEmptyMap from an Iterable or None otherwise.

Constructs a NonEmptyMap from an Iterable or None otherwise.

Attributes

def fromMap[K, V](elem: (K, V), others: Map[K, V]): NonEmptyMap[K, V]

Constructs a NonEmptyMap from an element and Map.

Constructs a NonEmptyMap from an element and Map.

Attributes

def fromMapOption[K, V](map: Map[K, V]): Option[NonEmptyMap[K, V]]

Constructs a NonEmptyMap from a Map or None otherwise.

Constructs a NonEmptyMap from a Map or None otherwise.

Attributes

Constructs a NonEmptyMap from a NonEmptyChunk.

Constructs a NonEmptyMap from a NonEmptyChunk.

Attributes

Constructs a NonEmptyMap from a NonEmptyList.

Constructs a NonEmptyMap from a NonEmptyList.

Attributes

from a non-empty chunk we can create a non-empty map of non-empty chunks

from a non-empty chunk we can create a non-empty map of non-empty chunks

Attributes

from a non-empty list we can create a non-empty map of non-empty list

from a non-empty list we can create a non-empty map of non-empty list

Attributes

from a non-empty set we can create a non-empty map of non-empty sets

from a non-empty set we can create a non-empty map of non-empty sets

Attributes

def groupByOption[A, K](from: Iterable[A])(f: A => K): Option[NonEmptyMap[K, Iterable[A]]]

GroupByOption function returns an option of a nonEmpty map instead of a map because by definition the elements will be non-empty - returns None if from is

GroupByOption function returns an option of a nonEmpty map instead of a map because by definition the elements will be non-empty - returns None if from is

Attributes

def single[K, V](head: (K, V)): NonEmptyMap[K, V]

Constructs a NonEmptyMap with the specified single value.

Constructs a NonEmptyMap with the specified single value.

Attributes

def unapply[K, V](arg: NonEmptyMap[K, V]): Some[((K, V), Map[K, V])]

Implicits

Implicits

implicit def toMap[K, V](nonEmptyMap: NonEmptyMap[K, V]): Map[K, V]

Provides an implicit conversion from NonEmptyMap to the Map for interoperability with Scala's collection library.

Provides an implicit conversion from NonEmptyMap to the Map for interoperability with Scala's collection library.

Attributes