Class/Object

com.github.tarao.nonempty

NonEmpty

Related Docs: object NonEmpty | package nonempty

Permalink

final class NonEmpty[+A] extends AnyVal

A value class for non-empty iterable collections.

It is intended to be used as a parameter type to restrict a collection value to be non-empty. This restriction is guaranteed statically, i.e., it is not possible to pass an empty collection as a parameter of type NonEmpty[].

The static safety is guaranteed by three reasons:

  1. there is no way to create a new instance of NonEmpty[] other than by factory methods provided by singleton object NonEmpty
  2. there is only two factory methods:
    • an implicit conversion from Iterable[A] to Option[NonEmpty[A]] where an empty value will be None
    • NonEmpty.apply, which takes at least one argument
  3. the implicit conversion copies the elements of a mutable collection in case the collection drops the elements

A value of type NonEmpty[A] can be used as a Iterable[A] by an implicit conversion from NonEmpty[A] to Iterable[A]. It also has some collection methods that preserve non-emptiness.

Source
NonEmpty.scala
Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NonEmpty
  2. AnyVal
  3. Any
Implicitly
  1. by toIterable
  2. by any2stringadd
  3. by StringFormat
  4. by Ensuring
  5. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

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

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

    Permalink
    Definition Classes
    Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to any2stringadd[NonEmpty[A]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ++[B](that: TraversableOnce[B]): NonEmpty[B]

    Permalink

    [use case] Returns a new collection containing the elements from the left hand operand followed by the elements from the right hand operand.

    [use case]

    Returns a new collection containing the elements from the left hand operand followed by the elements from the right hand operand. The element type of the collection is the most specific superclass encompassing the element types of the two operands.

    Example:

    scala> val a = NonEmpty(1)
    a: NonEmpty[Int] = List(1)
    
    scala> val b = NonEmpty(2)
    b: NonEmpty[Int] = List(2)
    
    scala> val c = a ++ b
    c: NonEmpty[Int] = List(1, 2)
    
    scala> val d = NonEmpty('a')
    d: NonEmpty[Char] = List(a)
    
    scala> val e = c ++ d
    e: NonEmpty[AnyVal] = List(1, 2, a)
    B

    the element type of the returned collection.

    that

    the traversable to append.

    returns

    a new collection which contains all elements of this collection followed by all elements of that.

    Full Signature

    def ++[B >: A, That](that: TraversableOnce[B])(implicit bf: CanBuildFrom[A, B, That]): That

  5. def ++:[B >: A, That](that: Traversable[B])(implicit bf: scala.collection.generic.CanBuildFrom[Iterable[A], B, That]): That

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike
  6. def ++:[B >: A, That](that: TraversableOnce[B])(implicit bf: scala.collection.generic.CanBuildFrom[Iterable[A], B, That]): That

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike
  7. def ->[B](y: B): (NonEmpty[A], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to ArrowAssoc[NonEmpty[A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  8. def /:[B](z: B)(op: (B, A) ⇒ B): B

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  9. def :\[B](z: B)(op: (A, B) ⇒ B): B

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  10. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  11. def addString(b: StringBuilder): StringBuilder

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce
  12. def addString(b: StringBuilder, sep: String): StringBuilder

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce
  13. def addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce
  14. def aggregate[B](z: ⇒ B)(seqop: (B, A) ⇒ B, combop: (B, B) ⇒ B): B

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  15. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  16. def canEqual(that: Any): Boolean

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → Equals
  17. def collect[B, That](pf: PartialFunction[A, B])(implicit bf: scala.collection.generic.CanBuildFrom[Iterable[A], B, That]): That

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike → GenTraversableLike
  18. def collectFirst[B](pf: PartialFunction[A, B]): Option[B]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce
  19. def companion: GenericCompanion[Iterable]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    Iterable → GenIterable → Traversable → GenTraversable → GenericTraversableTemplate
  20. def copyToArray[B >: A](xs: Array[B], start: Int, len: Int): Unit

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → TraversableLike → TraversableOnce → GenTraversableOnce
  21. def copyToArray[B >: A](xs: Array[B]): Unit

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  22. def copyToArray[B >: A](xs: Array[B], start: Int): Unit

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  23. def copyToBuffer[B >: A](dest: Buffer[B]): Unit

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce
  24. def count(p: (A) ⇒ Boolean): Int

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  25. def drop(n: Int): Iterable[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → TraversableLike → GenTraversableLike
  26. def dropRight(n: Int): Iterable[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike
  27. def dropWhile(p: (A) ⇒ Boolean): Iterable[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike → GenTraversableLike
  28. def ensuring(cond: (NonEmpty[A]) ⇒ Boolean, msg: ⇒ Any): NonEmpty[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Ensuring[NonEmpty[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  29. def ensuring(cond: (NonEmpty[A]) ⇒ Boolean): NonEmpty[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Ensuring[NonEmpty[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  30. def ensuring(cond: Boolean, msg: ⇒ Any): NonEmpty[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Ensuring[NonEmpty[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  31. def ensuring(cond: Boolean): NonEmpty[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Ensuring[NonEmpty[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  32. def exists(p: (A) ⇒ Boolean): Boolean

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → TraversableLike → TraversableOnce → GenTraversableOnce
  33. def filter(p: (A) ⇒ Boolean): Iterable[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike → GenTraversableLike
  34. def filterNot(p: (A) ⇒ Boolean): Iterable[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike → GenTraversableLike
  35. def find(p: (A) ⇒ Boolean): Option[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → TraversableLike → TraversableOnce → GenTraversableOnce
  36. def flatMap[B, That](f: (A) ⇒ GenTraversableOnce[B])(implicit bf: scala.collection.generic.CanBuildFrom[Iterable[A], B, That]): That

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike → GenTraversableLike → FilterMonadic
  37. def flatten[B](implicit asTraversable: (A) ⇒ GenTraversableOnce[B]): Iterable[B]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    GenericTraversableTemplate
  38. def fold[A1 >: A](z: A1)(op: (A1, A1) ⇒ A1): A1

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  39. def foldLeft[B](z: B)(op: (B, A) ⇒ B): B

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  40. def foldRight[B](z: B)(op: (A, B) ⇒ B): B

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → TraversableOnce → GenTraversableOnce
  41. def forall(p: (A) ⇒ Boolean): Boolean

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → TraversableLike → TraversableOnce → GenTraversableOnce
  42. def foreach[U](f: (A) ⇒ U): Unit

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → TraversableLike → GenTraversableLike → TraversableOnce → GenTraversableOnce → FilterMonadic
  43. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to StringFormat[NonEmpty[A]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  44. def genericBuilder[B]: Builder[B, Iterable[B]]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    GenericTraversableTemplate
  45. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  46. def groupBy[K](f: (A) ⇒ K): Map[K, NonEmpty[A]]

    Permalink

    Partitions this collection into a map of collections according to some discriminator function.

    Partitions this collection into a map of collections according to some discriminator function.

    K

    the type of keys returned by the discriminator function.

    f

    the discriminator function.

    returns

    A map from keys to collections such that the following invariant holds:

    (xs groupBy f)(k) = xs filter (x => f(x) == k)

    That is, every key k is bound to a collection of those elements x for which f(x) equals k.

  47. def grouped(size: Int): Iterator[NonEmpty[A]]

    Permalink

    Partitions elements in fixed size collections.

    Partitions elements in fixed size collections.

    size

    the number of elements per group

    returns

    An iterator producing collections of size size, except the last will be less than size size if the elements don't divide evenly.

  48. def hasDefiniteSize: Boolean

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike → TraversableOnce → GenTraversableOnce
  49. def head: A

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → TraversableLike → GenTraversableLike
  50. def headOption: Option[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike → GenTraversableLike
  51. def init: Iterable[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike → GenTraversableLike
  52. def inits: Iterator[Iterable[A]]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike
  53. def isEmpty: Boolean

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → TraversableLike → TraversableOnce → GenTraversableOnce
  54. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  55. final def isTraversableAgain: Boolean

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike → GenTraversableLike → GenTraversableOnce
  56. def iterator: Iterator[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → GenIterableLike
  57. def last: A

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike → GenTraversableLike
  58. def lastOption: Option[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike → GenTraversableLike
  59. def map[B](f: (A) ⇒ B): NonEmpty[B]

    Permalink

    [use case] Builds a new collection by applying a function to all elements of this collection.

    [use case]

    Builds a new collection by applying a function to all elements of this collection.

    B

    the element type of the returned collection.

    f

    the function to apply to each element.

    returns

    a new collection resulting from applying the given function f to each element of this collection and collecting the results.

    Full Signature

    def map[B, That](f: (A) ⇒ B)(implicit bf: CanBuildFrom[A, B, That]): That

  60. def max[B >: A](implicit cmp: Ordering[B]): A

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  61. def maxBy[B](f: (A) ⇒ B)(implicit cmp: Ordering[B]): A

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  62. def min[B >: A](implicit cmp: Ordering[B]): A

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  63. def minBy[B](f: (A) ⇒ B)(implicit cmp: Ordering[B]): A

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  64. def mkString: String

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  65. def mkString(sep: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  66. def mkString(start: String, sep: String, end: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  67. def nonEmpty: Boolean

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  68. def par: ParIterable[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    Parallelizable
  69. def partition(p: (A) ⇒ Boolean): (Iterable[A], Iterable[A])

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike → GenTraversableLike
  70. def product[B >: A](implicit num: Numeric[B]): B

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  71. def reduce[A1 >: A](op: (A1, A1) ⇒ A1): A1

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  72. def reduceLeft[B >: A](op: (B, A) ⇒ B): B

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce
  73. def reduceLeftOption[B >: A](op: (B, A) ⇒ B): Option[B]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  74. def reduceOption[A1 >: A](op: (A1, A1) ⇒ A1): Option[A1]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  75. def reduceRight[B >: A](op: (A, B) ⇒ B): B

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → TraversableOnce → GenTraversableOnce
  76. def reduceRightOption[B >: A](op: (A, B) ⇒ B): Option[B]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  77. def repr: Iterable[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike → GenTraversableLike
  78. def sameElements[B >: A](that: GenIterable[B]): Boolean

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → GenIterableLike
  79. def scan[B >: A, That](z: B)(op: (B, B) ⇒ B)(implicit bf: CanBuildFrom[A, B, That]): That

    Permalink

    Computes a prefix scan of the elements of the collection.

    Computes a prefix scan of the elements of the collection.

    Note: The neutral element z may be applied more than once.

    B

    element type of the resulting collection

    That

    type of the resulting collection

    z

    neutral element for the operator op

    op

    the associative operator for the scan

    bf

    combiner factory which provides a combiner

    returns

    a new collection containing the prefix scan of the elements in this collection

  80. def scanLeft[B, That](z: B)(op: (B, A) ⇒ B)(implicit bf: CanBuildFrom[A, B, That]): That

    Permalink

    Produces a collection containing cumulative results of applying the operator going left to right.

    Produces a collection containing cumulative results of applying the operator going left to right.

    Note: will not terminate for infinite-sized collections.

    Note: might return different results for different runs, unless the underlying collection type is ordered.

    B

    the type of the elements in the resulting collection

    That

    the actual type of the resulting collection

    z

    the initial value

    op

    the binary operator applied to the intermediate result and the element

    bf

    an implicit value of class CanBuildFrom which determines the result class That from the current representation type Repr and and the new element type B.

    returns

    collection with intermediate results

  81. def scanRight[B, That](z: B)(op: (A, B) ⇒ B)(implicit bf: CanBuildFrom[A, B, That]): That

    Permalink

    Produces a collection containing cumulative results of applying the operator going right to left.

    Produces a collection containing cumulative results of applying the operator going right to left. The head of the collection is the last cumulative result.

    Note: will not terminate for infinite-sized collections.

    Note: might return different results for different runs, unless the underlying collection type is ordered.

    Example:

    NonEmpty(1, 2, 3, 4).scanRight(0)(_ + _) == NonEmpty(10, 9, 7, 4, 0)
    B

    the type of the elements in the resulting collection

    That

    the actual type of the resulting collection

    z

    the initial value

    op

    the binary operator applied to the intermediate result and the element

    bf

    an implicit value of class CanBuildFrom which determines the result class That from the current representation type Repr and and the new element type B.

    returns

    collection with intermediate results

  82. def seq: Iterable[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    Iterable → GenIterable → Traversable → GenTraversable → Parallelizable → TraversableOnce → GenTraversableOnce
  83. def size: Int

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  84. def slice(from: Int, until: Int): Iterable[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → TraversableLike → GenTraversableLike
  85. def sliding(size: Int, step: Int): Iterator[Iterable[A]]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike
  86. def sliding(size: Int): Iterator[Iterable[A]]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike
  87. def span(p: (A) ⇒ Boolean): (Iterable[A], Iterable[A])

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike → GenTraversableLike
  88. def splitAt(n: Int): (Iterable[A], Iterable[A])

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike → GenTraversableLike
  89. def stringPrefix: String

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike → GenTraversableLike
  90. def sum[B >: A](implicit num: Numeric[B]): B

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  91. def tail: Iterable[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike → GenTraversableLike
  92. def tails: Iterator[Iterable[A]]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike
  93. def take(n: Int): Iterable[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → TraversableLike → GenTraversableLike
  94. def takeRight(n: Int): Iterable[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike
  95. def takeWhile(p: (A) ⇒ Boolean): Iterable[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → TraversableLike → GenTraversableLike
  96. def to[Col[_]](implicit cbf: scala.collection.generic.CanBuildFrom[Nothing, A, Col[A]]): Col[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike → TraversableOnce → GenTraversableOnce
  97. def toArray[B >: A](implicit arg0: ClassTag[B]): Array[B]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  98. def toBuffer[B >: A]: Buffer[B]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  99. def toIndexedSeq: IndexedSeq[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  100. def toIterable: Iterable[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → TraversableOnce → GenTraversableOnce
  101. def toIterator: Iterator[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → TraversableLike → GenTraversableOnce
    Annotations
    @deprecatedOverriding( ... , "2.11.0" )
  102. def toList: List[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  103. def toMap[T, U](implicit ev: <:<[A, (T, U)]): Map[T, U]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  104. def toSeq: Seq[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  105. def toSet[B >: A]: Set[B]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  106. def toStream: Stream[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → TraversableLike → GenTraversableOnce
  107. def toString(): String

    Permalink
    Definition Classes
    NonEmpty → Any
  108. def toTraversable: Traversable[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike → TraversableOnce → GenTraversableOnce
    Annotations
    @deprecatedOverriding( ... , "2.11.0" )
  109. def toVector: Vector[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableOnce → GenTraversableOnce
  110. def transpose[B](implicit asTraversable: (A) ⇒ GenTraversableOnce[B]): Iterable[Iterable[B]]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    GenericTraversableTemplate
    Annotations
    @migration
    Migration

    (Changed in version 2.9.0) transpose throws an IllegalArgumentException if collections are not uniformly sized.

  111. def unzip[A1, A2](implicit asPair: (A) ⇒ (A1, A2)): (NonEmpty[A1], NonEmpty[A2])

    Permalink

    Converts this collection of pairs into two collections of the first and second half of each pair.

    Converts this collection of pairs into two collections of the first and second half of each pair.

    val xs = NonEmpty(
               (1, "one"),
               (2, "two"),
               (3, "three")).unzip
    // xs == (NonEmpty(1, 2, 3),
    //        NonEmpty(one, two, three))
    A1

    the type of the first half of the element pairs

    A2

    the type of the second half of the element pairs

    asPair

    an implicit conversion which asserts that the element type of this collection is a pair.

    returns

    a pair of collections, containing the first, respectively second half of each element pair of this collection.

  112. def unzip3[A1, A2, A3](implicit asTriple: (A) ⇒ (A1, A2, A3)): (NonEmpty[A1], NonEmpty[A2], NonEmpty[A3])

    Permalink

    Converts this collection of triples into three collections of the first, second, and third element of each triple.

    Converts this collection of triples into three collections of the first, second, and third element of each triple.

    val xs = NonEmpty(
               (1, "one", '1'),
               (2, "two", '2'),
               (3, "three", '3')).unzip3
    // xs == (NonEmpty(1, 2, 3),
    //        NonEmpty(one, two, three),
    //        NonEmpty(1, 2, 3))
    A1

    the type of the first member of the element triples

    A2

    the type of the second member of the element triples

    A3

    the type of the third member of the element triples

    asTriple

    an implicit conversion which asserts that the element type of this collection is a triple.

    returns

    a triple of collections, containing the first, second, respectively third member of each element triple of this collection.

  113. def view(from: Int, until: Int): IterableView[A, Iterable[A]]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → TraversableLike
  114. def view: IterableView[A, Iterable[A]]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → TraversableLike
  115. def withFilter(p: (A) ⇒ Boolean): FilterMonadic[A, Iterable[A]]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    TraversableLike → FilterMonadic
  116. def zip[A1 >: A, B, That](that: GenIterable[B])(implicit bf: scala.collection.generic.CanBuildFrom[Iterable[A], (A1, B), That]): That

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Definition Classes
    IterableLike → GenIterableLike
  117. def zipAll[B](that: Iterable[B], thisElem: A, thatElem: B): NonEmpty[(A, B)]

    Permalink

    [use case] Returns a collection formed from this collection and another iterable collection by combining corresponding elements in pairs.

    [use case]

    Returns a collection formed from this collection and another iterable collection by combining corresponding elements in pairs. If one of the two collections is shorter than the other, placeholder elements are used to extend the shorter collection to the length of the longer.

    Note: might return different results for different runs, unless the underlying collection type is ordered.

    B

    the type of the second half of the returned pairs

    that

    the iterable providing the second half of each result pair

    thisElem

    the element to be used to fill up the result if this collection is shorter than that.

    thatElem

    the element to be used to fill up the result if that is shorter than this collection.

    returns

    a new collection containing pairs consisting of corresponding elements of this collection and that. The length of the returned collection is the maximum of the lengths of this collection and that. If this collection is shorter than that, thisElem values are used to pad the result. If that is shorter than this collection, thatElem values are used to pad the result.

    Full Signature

    def zipAll[B, A1 >: A, That](that: GenIterable[B], thisElem: A1, thatElem: B)(implicit bf: CanBuildFrom[A, (A1, B), That]): That

  118. def zipWithIndex: NonEmpty[(A, Int)]

    Permalink

    [use case] Zips this collection with its indices.

    [use case]

    Zips this collection with its indices.

    Note: might return different results for different runs, unless the underlying collection type is ordered.

    returns

    a new collection containing pairs consisting of all elements of this collection paired with their index. Indices start at 0.

    Full Signature

    def zipWithIndex[A1 >: A, That](implicit bf: CanBuildFrom[A, (A1, Int), That]): That

    Example:
    1. NonEmpty("a", "b", "c").zipWithIndex = NonEmpty(("a", 0), ("b", 1), ("c", 2))

  119. def [B](y: B): (NonEmpty[A], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to ArrowAssoc[NonEmpty[A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. def ++[B >: A, That](that: GenTraversableOnce[B])(implicit bf: scala.collection.generic.CanBuildFrom[Iterable[A], B, That]): That

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (nonEmpty: Iterable[A]).++(that)(bf)
    Definition Classes
    TraversableLike → GenTraversableLike
  2. def groupBy[K](f: (A) ⇒ K): Map[K, Iterable[A]]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (nonEmpty: Iterable[A]).groupBy(f)
    Definition Classes
    TraversableLike → GenTraversableLike
  3. def grouped(size: Int): Iterator[Iterable[A]]

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (nonEmpty: Iterable[A]).grouped(size)
    Definition Classes
    IterableLike
  4. def map[B, That](f: (A) ⇒ B)(implicit bf: scala.collection.generic.CanBuildFrom[Iterable[A], B, That]): That

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (nonEmpty: Iterable[A]).map(f)(bf)
    Definition Classes
    TraversableLike → GenTraversableLike → FilterMonadic
  5. def scan[B >: A, That](z: B)(op: (B, B) ⇒ B)(implicit cbf: scala.collection.generic.CanBuildFrom[Iterable[A], B, That]): That

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (nonEmpty: Iterable[A]).scan(z)(op)(cbf)
    Definition Classes
    TraversableLike → GenTraversableLike
  6. def scanLeft[B, That](z: B)(op: (B, A) ⇒ B)(implicit bf: scala.collection.generic.CanBuildFrom[Iterable[A], B, That]): That

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (nonEmpty: Iterable[A]).scanLeft(z)(op)(bf)
    Definition Classes
    TraversableLike → GenTraversableLike
  7. def scanRight[B, That](z: B)(op: (A, B) ⇒ B)(implicit bf: scala.collection.generic.CanBuildFrom[Iterable[A], B, That]): That

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (nonEmpty: Iterable[A]).scanRight(z)(op)(bf)
    Definition Classes
    TraversableLike → GenTraversableLike
    Annotations
    @migration
    Migration

    (Changed in version 2.9.0) The behavior of scanRight has changed. The previous behavior can be reproduced with scanRight.reverse.

  8. def toString(): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (nonEmpty: Iterable[A]).toString()
    Definition Classes
    TraversableLike → Any
  9. def unzip[A1, A2](implicit asPair: (A) ⇒ (A1, A2)): (Iterable[A1], Iterable[A2])

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (nonEmpty: Iterable[A]).unzip(asPair)
    Definition Classes
    GenericTraversableTemplate
  10. def unzip3[A1, A2, A3](implicit asTriple: (A) ⇒ (A1, A2, A3)): (Iterable[A1], Iterable[A2], Iterable[A3])

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (nonEmpty: Iterable[A]).unzip3(asTriple)
    Definition Classes
    GenericTraversableTemplate
  11. def zipAll[B, A1 >: A, That](that: GenIterable[B], thisElem: A1, thatElem: B)(implicit bf: scala.collection.generic.CanBuildFrom[Iterable[A], (A1, B), That]): That

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (nonEmpty: Iterable[A]).zipAll(that, thisElem, thatElem)(bf)
    Definition Classes
    IterableLike → GenIterableLike
  12. def zipWithIndex[A1 >: A, That](implicit bf: scala.collection.generic.CanBuildFrom[Iterable[A], (A1, Int), That]): That

    Permalink
    Implicit information
    This member is added by an implicit conversion from NonEmpty[A] to Iterable[A] performed by method toIterable in com.github.tarao.nonempty.NonEmpty.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (nonEmpty: Iterable[A]).zipWithIndex(bf)
    Definition Classes
    IterableLike → GenIterableLike

Inherited from AnyVal

Inherited from Any

Inherited by implicit conversion toIterable from NonEmpty[A] to Iterable[A]

Inherited by implicit conversion any2stringadd from NonEmpty[A] to any2stringadd[NonEmpty[A]]

Inherited by implicit conversion StringFormat from NonEmpty[A] to StringFormat[NonEmpty[A]]

Inherited by implicit conversion Ensuring from NonEmpty[A] to Ensuring[NonEmpty[A]]

Inherited by implicit conversion ArrowAssoc from NonEmpty[A] to ArrowAssoc[NonEmpty[A]]

Ungrouped