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

Function iterate

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

Source from the content-addressed store, hash-verified

1665 * @since 2.0.0
1666 */
1667export const iterate = <A>(value: A, next: (value: A) => A): Stream<A> =>
1668 unfold(value, (a) => Effect.succeed([a, next(a)]))
1669
1670/**
1671 * 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