MCPcopy Create free account
hub / github.com/datner/react-effect / parallel

Function parallel

test/utils/cause.ts:32–36  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

30 }
31
32 const parallel = (n: number): fc.Arbitrary<Cause.Cause<E>> => {
33 return fc.integer({ min: 1, max: n - 1 }).chain((i) =>
34 causesN(i).chain((left) => causesN(n - i).map((right) => Cause.parallel(left, right)))
35 )
36 }
37
38 const causesN = (n: number): fc.Arbitrary<Cause.Cause<E>> => {
39 if (n === 1) {

Callers 1

causesNFunction · 0.85

Calls 1

causesNFunction · 0.85

Tested by

no test coverage detected