Concatenates this NonEmptyList
with the specified NonEmptyList
.
Returns whether this NonEmptyList
contains the specified element.
Determines whether this NonEmptyList
and the specified NonEmptyList
have the same length and every pair of corresponding elements of this
NonEmptyList
and the specified NonEmptyList
satisfy the specified
predicate.
Determines whether this NonEmptyList
and the specified NonEmptyList
have the same length and every pair of corresponding elements of this
NonEmptyList
and the specified NonEmptyList
satisfy the specified
predicate.
Returns the number of elements in this NonEmptyList
that satisfy the
specified predicate.
Removes duplicate elements from this NonEmptyList
.
Drops the first n
elements from this NonEmptyList
returning a List
.
Drops the first n
elements from this NonEmptyList
returning a List
.
Drops the last n
elements from this NonEmptyList
returning a List
.
Drops elements from the start of this NonEmptyList
that satisfy the
specified predicate returning a List
.
Drops elements from the start of this NonEmptyList
that satisfy the
specified predicate returning a List
.
Returns whether this NonEmptyList
and the specified NonEmptyList
are
equal to each other.
Returns whether this NonEmptyList
and the specified NonEmptyList
are
equal to each other.
Returns whether an element exists in this NonEmptyList
satisfying the
specified predicate.
Returns whether an element exists in this NonEmptyList
satisfying the
specified predicate.
Returns the first element in this NonEmptyList
satisfying the
specified predicate or None
otherwise.
Returns the first element in this NonEmptyList
satisfying the
specified predicate or None
otherwise.
Transforms each element of this NonEmptyList
to a NonEmptyList
and
combines them into a single NonEmptyList
.
Flattens a NonEmptyList
of NonEmptyList
values into a single
NonEmptyList
.
Folds over the elements of this NonEmptyList
from left to right using
the specified initial value and combining function
Folds over the elements of this NonEmptyList
from left to right using
the specified initial value and combining function
Folds over the elements of this NonEmptyList
from right to left using
the specified initial value and combining function.
Transforms each element of this NonEmptyList
with the specified
effectual function.
Returns whether all elements of this NonEmptyList
satisfy the specified
predicate.
Returns whether all elements of this NonEmptyList
satisfy the specified
predicate.
Returns the hashCode of this NonEmptyList
.
Returns the hashCode of this NonEmptyList
.
Returns the length of this NonEmptyList
.
Transforms the elements of this NonEmptyList
with the specified
function.
Returns the maximum element in this NonEmptyList
.
Returns the maximum element in this NonEmptyList
using the specified
function to map values of type A
to values of type B
that an ordering
is defined on.
Returns the minimum element in this NonEmptyList
.
Returns the minimum element in this NonEmptyList
using the specified
function to map values of type A
to values of type B
that an ordering
is defined on.
Renders the elements of this NonEmptyList
as a String
using the
specified separator and start and end values.
Renders the elements of this NonEmptyList
as a String
using the
specified separator.
Renders the elements of this NonEmptyList
as a String
.
Decomposes the NonEmptyList
into an element and a (possibly empty) List
Returns an element of this NonEmptyList
and the remainder or None
, if the remainder is empty.
Returns the product of the elements of this NonEmptyList
.
Reduces the elements of this NonEmptyList
using the specified
associative operator.
Reduces the elements of this NonEmptyList
from left to right using the
specified function.
Maps each element of this NonEmptyList
to a type B
that has an
associative operation then combines them all with the associative
operation.
Reduces the elements of this NonEmptyList
from left to right using the
function map
to transform the first value to the type B
and then the
function reduceAll
to combine the B
value with each other A
value.
Reduces the elements of this NonEmptyList
from right to left using the
function map
to transform the first value to the type B
and then the
function reduceAll
to combine the B
value with each other A
value.
Reduces the elements of this NonEmptyList
from right to left using the
specified function.
Reverses the order of elements in this NonEmptyList
.
Returns the sum of the elements of this NonEmptyList
.
Returns the tail of this NonEmptyList
if it exists or None
otherwise.
Returns a new NonEmptyList
composed of this NonEmptyList
followed by
each of its tails, ending with a singleton NonEmptyList
.
Takes the first n
elements from this NonEmptyList
returning a List
.
Takes the last n
elements from this NonEmptyList
returning a List
.
Takes elements from the start of this NonEmptyList
that satisfy the
specified predicate returning a List
.
Converts this NonEmptyList
to the ::
case of a List
.
Converts this NonEmptyList
to a NonEmptyChunk
.
Renders this NonEmptyList
as a String
.
Renders this NonEmptyList
as a String
.
Zips this NonEmptyList
together with the specified NonEmptyList
,
returning a new NonEmptyList
with a length equal to the minimum of the
two and elements combined pairwise.
Zips this NonEmptyList
together with the specified NonEmptyList
,
returning a new NonEmptyList
with a length equal to the minimum of the
two and elements combined pairwise using the specified function.
Annotates each element of this NonEmptyList
with its index.
A
NonEmptyList[A]
is a list of one or more values of type A. Unlike aList
, aNonEmptyList
is guaranteed to contain at least one element. This additional structure allows some operations to be defined onNonEmptyList
that are not safe onList
, such ashead
andreduceAll
.For interoperability with Scala's collection library an implicit conversion is provided from
NonEmptyList
to the::
case ofList
. Operations that cannot preserve the guarantee that the resulting collection must have at least one element will return aList
instead.