Module tanya.algorithm.iteration

Iteration algorithms.

These algorithms wrap other ranges and modify the way, how the original range is iterated, or the order in which its elements are accessed.

All algorithms in this module are lazy, they request the next element of the original range on demand.

Functions

NameDescription
retro(range) Iterates a bidirectional range backwards.
singleton(element) Creates a bidirectional and random-access range with the single element element.
take(range, n) Takes n elements from range.
takeExactly(range, n) Takes exactly n elements from range.

Templates

NameDescription
foldl Accumulates all elements of a range using a function.
foldr Accumulates all elements of a range using a function.