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

Function loop

packages/effect/test/STM.test.ts:69–77  ·  view source on GitHub ↗
(_n: number, _acc: STM.STM<number>)

Source from the content-addressed store, hash-verified

67 next: (stm: STM.STM<number>) => STM.STM<number>
68): Effect.Effect<number> => {
69 const loop = (_n: number, _acc: STM.STM<number>): Effect.Effect<number> => {
70 let n = _n
71 let acc = _acc
72 while (n > 0) {
73 acc = next(acc)
74 n = n - 1
75 }
76 return STM.commit(acc)
77 }
78 return loop(depth, STM.succeed(0))
79}
80

Callers 2

chainFunction · 0.70
chainErrorFunction · 0.70

Calls 3

pipeFunction · 0.90
nextFunction · 0.70
commitMethod · 0.45

Tested by

no test coverage detected