NonEmptyList

izumi.fundamentals.collections.nonempty.NonEmptyList$
See theNonEmptyList companion class

Companion object for class NonEmptyList.

Attributes

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

Members list

Concise view

Type members

Classlikes

final implicit class OptionOps[+A](option: Option[NonEmptyList[A]]) extends AnyVal

Attributes

Graph
Supertypes
class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def apply[T](singleElement: T): NonEmptyList[T]

Constructs a new NonEmptyList of one element

Constructs a new NonEmptyList of one element

Attributes

def apply[T](firstElement: T, secondElement: T, otherElements: T*): NonEmptyList[T]

Constructs a new NonEmptyList given at least two elements.

Constructs a new NonEmptyList given at least two elements.

Attributes

T

the type of the element contained in the new NonEmptyList

firstElement

the first element (with index 0) contained in this NonEmptyList

otherElements

a varargs of zero or more other elements (with index 1, 2, 3, ...) contained in this NonEmptyList

def apply[T](firstElement: T, otherElements: Iterable[T]): NonEmptyList[T]

Constructs a new NonEmptyList given at least one element.

Constructs a new NonEmptyList given at least one element.

Attributes

def from[T](list: List[T]): Option[NonEmptyList[T]]

Optionally construct a NonEmptyList containing the elements, if any, of a given List.

Optionally construct a NonEmptyList containing the elements, if any, of a given List.

Attributes

list

the List with which to construct a NonEmptyList

Returns:

a NonEmptyList containing the elements of the given List, if non-empty, wrapped in a Some; else None if the List is empty

def from[T](seq: Iterable[T]): Option[NonEmptyList[T]]

Optionally construct a NonEmptyList containing the elements, if any, of a given Seq.

Optionally construct a NonEmptyList containing the elements, if any, of a given Seq.

Attributes

seq

the Seq with which to construct a NonEmptyList

Returns:

a NonEmptyList containing the elements of the given Seq, if non-empty, wrapped in a Some; else None if the Seq is empty

def from[T](iterableOnce: IterableOnce[T]): Option[NonEmptyList[T]]
def unapplySeq[T](nonEmptyList: NonEmptyList[T]): Some[Seq[T]]

Variable argument extractor for NonEmptyLists.

Variable argument extractor for NonEmptyLists.

Attributes

nonEmptyList:

the NonEmptyList containing the elements to extract

Returns:

an Seq containing this NonEmptyLists elements, wrapped in a Some

def unsafeFrom[T](list: List[T]): NonEmptyList[T]

Implicits

Implicits

final implicit def OptionOps[A](option: Option[NonEmptyList[A]]): OptionOps[A]