iterable library

Some fancy iterables and iterators.

Classes

FixedLengthListMixin<E>
Mixin that throws on the length changing operations of List. [...]
Indexed<E>
An indexed value.
InfiniteIterable<E>
Mixin for infinitely sized iterables. [...]
UnmodifiableListMixin<E>
Mixin for an unmodifiable List class. [...]

Functions

combinations(Iterable elements, int count, { bool repetitions: false }) Iterable<List>
Returns an iterable over the combinations of elements of length count. The combinations are emitted in lexicographical order based on the input. [...]
concat(Iterable<Iterable> iterables) Iterable
Combines multiple iterables into a single iterable. [...]
cycle(Iterable iterable, [ int count = null ]) Iterable
Returns a iterable whose iterator cycles repeatedly over the elements of an iterable. If count is specified, the returned iterable has a finite size of iterable × count. If count is unspecified the returned iterable is of infinite size. [...]
digits(int number, [ int base = 10 ]) Iterable<int>
Returns an iterable over the digits of the number, in the optionally given base.
empty() Iterable
Returns an efficient empty iterable. [...]
fibonacci([int f0 = 0, int f1 = 1 ]) Iterable<int>
Returns an iterable over the fibonacci sequence starting with f0 and f1. The default sequence is indefinitely long and by default starts with 0, 1, 1, 2, 3, 5, 8, 13, ...
fold(Iterable elements, Function combine) Iterable
Returns a lazy infinite list of repeated applications of the n-ary function to its previous n initial elements. [...]
indexed(Iterable iterable, { int offset: 0 }) Iterable<Indexed>
Returns a Indexed iterable [...]
iterate(dynamic value, dynamic function(dynamic value)) Iterable
Returns a lazy infinite list of repeated applications of the function to the initial value. [...]
permutations(Iterable elements) Iterable<List>
Returns an iterable over the permutations of elements. The permutations are emitted in lexicographical order based on the input. [...]
product(Iterable<Iterable> iterables) Iterable<List>
Returns an iterable over the cross product of iterables. [...]
repeat(dynamic element, [ int count ]) Iterable
Returns an infinite iterable with a constant element. If count is provided the resulting iterator is limited to count elements. [...]
unique(Iterable iterable, { bool equals(dynamic e1, dynamic e2), int hashCode(dynamic e) }) Iterable
Returns a lazy iterable that filters out duplicates from the iterator. If equals and hashCode are omitted, the iterator uses the objects' intrinsic Object.operator== and Object.hashCode for comparison. [...]