NonEmptyList

cats.data.NonEmptyList
See theNonEmptyList companion class
object NonEmptyList

Attributes

Companion
class
Source
NonEmptyList.scala
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

final class ZipNonEmptyList[A](val value: NonEmptyList[A]) extends AnyVal

Attributes

Companion
object
Source
NonEmptyList.scala
Supertypes
class AnyVal
trait Matchable
class Any

Attributes

Companion
class
Source
NonEmptyList.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
Source
Mirror.scala

The name of the type

The name of the type

Attributes

Inherited from:
Mirror
Source
Mirror.scala

Value members

Concrete methods

def fromFoldable[F[_], A](fa: F[A])(implicit F: Foldable[F]): Option[NonEmptyList[A]]

Attributes

Source
NonEmptyList.scala

Create a NonEmptyList from a List.

Create a NonEmptyList from a List.

The result will be None if the input list is empty and Some wrapping a NonEmptyList otherwise.

Attributes

See also

fromListUnsafe for an unsafe version that throws an exception if the input list is empty.

Source
NonEmptyList.scala

Create a NonEmptyList from a List, or throw an IllegalArgumentException if the input list is empty.

Create a NonEmptyList from a List, or throw an IllegalArgumentException if the input list is empty.

Attributes

See also

fromList for a safe version that returns None if the input list is empty.

Source
NonEmptyList.scala
def fromReducible[F[_], A](fa: F[A])(implicit F: Reducible[F]): NonEmptyList[A]

Attributes

Source
NonEmptyList.scala
def of[A](head: A, tail: A*): NonEmptyList[A]

Attributes

Source
NonEmptyList.scala
def ofInitLast[A](init: List[A], last: A): NonEmptyList[A]

Attributes

Source
NonEmptyList.scala
def one[A](head: A): NonEmptyList[A]

Attributes

Source
NonEmptyList.scala

Implicits

Inherited implicits

implicit def catsDataEqForNonEmptyList[A](implicit A: Eq[A]): Eq[NonEmptyList[A]]

Attributes

Inherited from:
NonEmptyListInstances1 (hidden)
Source
NonEmptyList.scala

This is not a bug.

This is not a bug. The declared type of catsDataInstancesForNonEmptyList intentionally ignores NonEmptyReducible trait for it not being a typeclass.

Also see the discussion: PR #3541 and issue #3069.

Attributes

Inherited from:
NonEmptyListInstances (hidden)
Source
NonEmptyList.scala
implicit def catsDataOrderForNonEmptyList[A](implicit A: Order[A]): Order[NonEmptyList[A]]

Attributes

Inherited from:
NonEmptyListInstances (hidden)
Source
NonEmptyList.scala