Hyperlinkv0.8.0-beta.28

Iterable

Iterable.repeatconsteffect/Iterable.ts:145
(n: number): <A>(self: Iterable<A>) => Iterable<A>
<A>(self: Iterable<A>, n: number): Iterable<A>

Repeats an iterable n times, yielding the full contents of self for each repetition.

When to use

Use to repeat an iterable's contents a specific number of times.

Details

The result is lazy. Each repetition obtains a new iterator from self.

constructorsforeverreplicate
export const repeat: {
  (n: number): <A>(self: Iterable<A>) => Iterable<A>
  <A>(self: Iterable<A>, n: number): Iterable<A>
} = dual(2, <A>(self: Iterable<A>, n: number): Iterable<A> => flatten(makeBy(() => self, { length: n })))
Referenced by 1 symbols