Class/Object

io.parsek

NonEmptyList

Related Docs: object NonEmptyList | package parsek

Permalink

final case class NonEmptyList[+A](head: A, tail: List[A]) extends Product with Serializable

Source: https://github.com/typelevel/cats/blob/master/core/src/main/scala/cats/data/NonEmptyList.scala

A data type which represents a non empty list of A, with single element (head) and optional structure (tail).

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NonEmptyList
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new NonEmptyList(head: A, tail: List[A])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def ++[AA >: A](l: List[AA]): NonEmptyList[AA]

    Permalink
  4. def ::[AA >: A](a: AA): NonEmptyList[AA]

    Permalink
  5. def :::[AA >: A](other: NonEmptyList[AA]): NonEmptyList[AA]

    Permalink

    Alias for concatNel

    Alias for concatNel

    scala> import cats.data.NonEmptyList
    scala> val nel = NonEmptyList.of(1, 2, 3)
    scala> nel ::: NonEmptyList.of(4, 5)
    res0: cats.data.NonEmptyList[Int] = NonEmptyList(1, 2, 3, 4, 5)
  6. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def collect[B](pf: PartialFunction[A, B]): List[B]

    Permalink

    Builds a new List by applying a partial function to all the elements from this NonEmptyList on which the function is defined

    Builds a new List by applying a partial function to all the elements from this NonEmptyList on which the function is defined

    scala> import cats.data.NonEmptyList
    scala> val nel = NonEmptyList.of(1, 2, 3, 4, 5)
    scala> nel.collect { case v if v < 3 => v }
    res0: scala.collection.immutable.List[Int] = List(1, 2)
    scala> nel.collect {
         |  case v if v % 2 == 0 => "even"
         |  case _ => "odd"
         | }
    res1: scala.collection.immutable.List[String] = List(odd, even, odd, even, odd)
  10. def concat[AA >: A](other: List[AA]): NonEmptyList[AA]

    Permalink
  11. def concatNel[AA >: A](other: NonEmptyList[AA]): NonEmptyList[AA]

    Permalink

    Append another NonEmptyList

  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def exists(p: (A) ⇒ Boolean): Boolean

    Permalink

    Check whether at least one element satisfies the predicate

  14. def filter(p: (A) ⇒ Boolean): List[A]

    Permalink

    Remove elements not matching the predicate

    Remove elements not matching the predicate

    scala> import cats.data.NonEmptyList
    scala> val nel = NonEmptyList.of(1, 2, 3, 4, 5)
    scala> nel.filter(_ < 3)
    res0: scala.collection.immutable.List[Int] = List(1, 2)
  15. def filterNot(p: (A) ⇒ Boolean): List[A]

    Permalink

    Remove elements matching the predicate

    Remove elements matching the predicate

    scala> import cats.data.NonEmptyList
    scala> val nel = NonEmptyList.of(1, 2, 3, 4, 5)
    scala> nel.filterNot(_ < 3)
    res0: scala.collection.immutable.List[Int] = List(3, 4, 5)
  16. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. def find(p: (A) ⇒ Boolean): Option[A]

    Permalink

    Find the first element matching the predicate, if one exists

  18. def flatMap[B](f: (A) ⇒ NonEmptyList[B]): NonEmptyList[B]

    Permalink
  19. def foldLeft[B](b: B)(f: (B, A) ⇒ B): B

    Permalink

    Left-associative fold on the structure using f.

  20. def forall(p: (A) ⇒ Boolean): Boolean

    Permalink

    Check whether all elements satisfy the predicate

  21. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  22. val head: A

    Permalink
  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. def last: A

    Permalink

    Selects the last element

    Selects the last element

    scala> import cats.data.NonEmptyList
    scala> val nel = NonEmptyList.of(1, 2, 3, 4, 5)
    scala> nel.last
    res0: Int = 5
  25. def length: Int

    Permalink
  26. def map[B](f: (A) ⇒ B): NonEmptyList[B]

    Permalink

    Applies f to all the elements of the structure

  27. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  28. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  29. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  30. def prepend[AA >: A](a: AA): NonEmptyList[AA]

    Permalink
  31. def size: Int

    Permalink

    The size of this NonEmptyList

    The size of this NonEmptyList

    scala> import cats.data.NonEmptyList
    scala> val nel = NonEmptyList.of(1, 2, 3, 4, 5)
    scala> nel.size
    res0: Int = 5
  32. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  33. val tail: List[A]

    Permalink
  34. def toList: List[A]

    Permalink

    Return the head and tail into a single list

    Return the head and tail into a single list

    scala> import cats.data.NonEmptyList
    scala> val nel = NonEmptyList.of(1, 2, 3, 4, 5)
    scala> nel.toList
    res0: scala.collection.immutable.List[Int] = List(1, 2, 3, 4, 5)
  35. def toString(): String

    Permalink
    Definition Classes
    NonEmptyList → AnyRef → Any
  36. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped