Difference Between `Effect.gen` and `Effect.fn` Usage

Good morning! I saw on a thread that it's recommended to use Effect.fn when a function that parameters, and return an effect.

is const foo = (bar: string) => Effect.gen(function* () {}).pipe(Effect.withSpan('hello')

the same as const foo = (bar: string) => Effect.fn('hello')(function* (bar: string) {})

?
Was this page helpful?