Returns true if there are no elements in this collection.
Alias for concat
Alias for prepend.
Alias for append.
Typesafe equality operator.
Typesafe equality operator.
This method is similar to == except that it only allows two Chain[A] values to be compared to each other, and uses equality provided by Eq[_] instances, rather than using the universal equality provided by .equals.
Returns a new Chain consisting of this followed by a
.
Returns a new Chain consisting of this followed by a
. O(1) runtime.
Collect B
from this for which f
is defined
Concatenates this with c
in O(1) runtime.
Check whether an element is in this structure
Yields to Some(a, Chain[A]) with a
removed where f
holds for the first time,
otherwise yields None, if a
was not found
Traverses only until a
is found.
Remove duplicates.
Remove duplicates. Duplicates are checked using Order[_]
instance.
Check whether at least one element satisfies the predicate
Remove elements not matching the predicate
Remove elements matching the predicate
Find the first element matching the predicate, if one exists
Applies the supplied function to each element and returns a new Chain from the concatenated results
Folds over the elements from left to right using the supplied initial value and function.
Folds over the elements from right to left using the supplied initial value and function.
Check whether all elements satisfy the predicate
Groups elements inside this Chain
according to the Order
of the keys produced by the given mapping function.
Returns the head of this Chain if non empty, none otherwise.
Returns the head of this Chain if non empty, none otherwise. Amortized O(1).
Returns the number of elements in this structure
Applies the supplied function to each element and returns a new Chain.
Returns false if there are no elements in this collection.
Returns a new Chain consisting of a
followed by this.
Returns a new Chain consisting of a
followed by this. O(1) runtime.
Reverses this Chain
Alias for length
Converts to a list.
Converts to a vector.
Returns the head and tail of this Chain if non empty, none otherwise.
Returns the head and tail of this Chain if non empty, none otherwise. Amortized O(1).
Zips this Chain
with another Chain
and applies a function for each pair of elements.
Trivial catenable sequence. Supports O(1) append, and (amortized) O(1)
uncons
, such that walking the sequence via N successiveuncons
steps takes O(N).