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

Function whileLoop

packages/effect/src/internal/core.ts:1390–1402  ·  view source on GitHub ↗
(
  options: {
    readonly while: LazyArg<boolean>
    readonly body: LazyArg<Effect.Effect<A, E, R>>
    readonly step: (a: A) => void
  }
)

Source from the content-addressed store, hash-verified

1388
1389/* @internal */
1390export const whileLoop = <A, E, R>(
1391 options: {
1392 readonly while: LazyArg<boolean>
1393 readonly body: LazyArg<Effect.Effect<A, E, R>>
1394 readonly step: (a: A) => void
1395 }
1396): Effect.Effect<void, E, R> => {
1397 const effect = new EffectPrimitive(OpCodes.OP_WHILE) as any
1398 effect.effect_instruction_i0 = options.while
1399 effect.effect_instruction_i1 = options.body
1400 effect.effect_instruction_i2 = options.step
1401 return effect
1402}
1403
1404/* @internal */
1405export const fromIterator = <Eff extends YieldWrap<Effect.Effect<any, any, any>>, AEff>(

Callers 2

forEachFunction · 0.85
core.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected