Comparing `Effect.fn` and `Effect.gen` for Tracing Effects Without Function Arguments

Regarding Effect.fn - assuming one wants to trace an effect - is there ever a reason to use Effect.gen over Effect.fn, assuming function args are not needed?

E.g. in the below, is there any benefit perf or otherwise to the Effect.gen version?

const myFunc = Effect.fn('myFunc')(function* () {
  // do it
});

const x = yield* myFunc();

// vs

const myFunc = Effect.gen(function* () {
// do it
}).pipe(Effect.withSpan('myFunc'));

const x = yield* myFunc;
Was this page helpful?