Seq¶
Import: import system.collections;
Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.
Seq¶
A repeatable query sequence whose filters and transformations run during traversal.
iterator¶
Creates an independent cursor. Closing it also closes every upstream cursor.
filter¶
Lazily keeps the elements for which p returns true.
take¶
Lazily keeps at most n elements; nonpositive counts produce an empty sequence.
skip¶
Lazily skips the first n elements; nonpositive counts skip nothing.
to_list¶
Collects the surviving elements into a fresh list.
count¶
Counts the surviving elements without building a list.
distinct¶
Lazily removes duplicates while preserving first-seen order.
sort_by¶
Immediately collects and sorts the sequence with cmp.
flat_map¶
Lazily maps each element to a list and visits each result in order.
map¶
Lazily transforms each element through f.
reduce¶
Combines elements in order, starting with init; returns init when empty.
collect_set¶
Collects the elements into a new set, removing duplicates.
min¶
Returns the smallest element by compare, or None when empty.
max¶
Returns the largest element by compare, or None when empty.