Hyperlinkv0.8.0-beta.28

Iterable

Iterable.foreverconsteffect/Iterable.ts:169
<A>(self: Iterable<A>): Iterable<A>

Repeats an iterable without an upper bound.

When to use

Use to cycle a reusable iterable without an upper bound when a downstream consumer controls how many values are taken.

Gotchas

The returned iterable is lazy and should usually be bounded with take or another terminating consumer before materializing it.

constructorsrepeattake
export const forever = <A>(self: Iterable<A>): Iterable<A> => repeat(self, Infinity)
Referenced by 1 symbols