MCPcopy Create free account
hub / github.com/Snowflyt/tinyeffect / fib4

Function fib4

test/README.example.spec.ts:1386–1389  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

1384 };
1385
1386 const fib4 = (n: number): Effected<never, number> => {
1387 if (n <= 1) return Effected.of(n);
1388 return fib4(n - 1).flatMap((a) => fib4(n - 2).map((b) => a + b));
1389 };
1390
1391 expect(fib1(10).runSync()).toBe(55);
1392 expect(fib2(10).runSync()).toBe(55);

Callers

nothing calls this directly

Calls 3

ofMethod · 0.80
flatMapMethod · 0.65
mapMethod · 0.65

Tested by

no test coverage detected