Showcasing the power of iterators
README.md

itertools #

A collection of Iterator functions inspired by Python's itertools module, adapted to the conventions of Go.

Python Go Description
count(start=0) Count[N Number](start N) iter.Seq[N] Yield numbers from start, incrementing by 1, without end.
count(start=0, step=1) CountStep[N Number](start, step N) iter.Seq[N] Yield numbers from start, incrementing by step, without end.
repeat(object) RepeatForever[T any](v T) iter.Seq[T] Yield the same value over and over, without end.
repeat(object, times) Repeat[T any](v T, times int) iter.Seq[T] Yield the same value times times, then stop.
islice(iterable, stop) Take[T any](n int, seq iter.Seq[T]) iter.Seq[T] Yield the first n items of the source sequence, then stop.
cycle(iterable) Cycle[T any](seq iter.Seq[T]) iter.Seq[T] Yield the values of seq, saving a copy, then repeat them endlessly.
chain(*iterables) Chain[T any](seqs ...iter.Seq[T]) iter.Seq[T] Yield the values of each sequence in turn, exhausting one before starting the next.
filter(predicate, iterable) Filter[T any](predicate func(T) bool, seq iter.Seq[T]) iter.Seq[T] Yield only the values of seq for which predicate returns true.

References #