MCPcopy Create free account
hub / github.com/Effect-TS/effect / iterate

Function iterate

packages/effect/src/Stream.ts:1540–1541  ·  view source on GitHub ↗
(value: A, next: (value: A) => A)

Source from the content-addressed store, hash-verified

1538 * @since 2.0.0
1539 */
1540export const iterate = <A>(value: A, next: (value: A) => A): Stream<A> =>
1541 unfold(value, (a) => Effect.succeed([a, next(a)]))
1542
1543/**
1544 * Constructs a stream from a range of integers, including both endpoints.

Callers

nothing calls this directly

Calls 3

unfoldFunction · 0.70
nextFunction · 0.70
succeedMethod · 0.45

Tested by

no test coverage detected