Using Lazy Evaluation in Effects Pipeline
What about something like a "I will need these resources somewhere in the execution. Please lazily resolve them when you can", for example:
pipe(
Effect.lazy(getSomethingExpensive()),
Effect.zipRight(doThing()),
Effect.flatMap(doThing1),
Effect.flatMap(doAsyncThing2),
Effect.flatMap(doThing3),
Effect.flatMap(doThing4),
Effect.flatMap(doThing5),
Effect.flatMap(t5 => pipe(
getSomethingExpensive(), // <- I'm cached since I found a window while doAsyncThing2 was deffered so I ran in parralel to it
Effect.flatMap(ex => doTheDew(ex, t5))
))
)