MCPcopy
hub / github.com/Effect-TS/effect / iterate

Function iterate

packages/effect/src/internal/stream.ts:3808–3809  ·  view source on GitHub ↗
(value: A, next: (value: A) => A)

Source from the content-addressed store, hash-verified

3806
3807/** @internal */
3808export const iterate = <A>(value: A, next: (value: A) => A): Stream.Stream<A> =>
3809 unfold(value, (a) => Option.some([a, next(a)] as const))
3810
3811/** @internal */
3812export const make = <As extends Array<any>>(...as: As): Stream.Stream<As[number]> => fromIterable(as)

Callers 1

core-effect.tsFile · 0.85

Calls 2

unfoldFunction · 0.70
nextFunction · 0.70

Tested by

no test coverage detected