Rewrite `E.gen` to `E.fn` for Piping Effects with Retry

how to rewrite the following using E.fn instead of E.gen
alot of times I want to pipe the Effect, for example Like adding a retry, but I don't know how to do that with E.fn
(entry) =>
            E.gen(function* () {
                const Key = `images/${flattenFilePath(entry.path, decompilerOutputsPath)}`;
                yield* E.logInfo(`Saving image: ${Key} to Object Storage`);
                const Body = yield* E.tryPromise({
                    try: () => Deno.readFile(entry.path),
                    catch: (e) => new Error("Couldn't read file", { cause: e }),
                });
                yield* putObject(Body, Key, "image/png");
            }).pipe(E.retry({ times: 3 }))
Was this page helpful?