Understanding Effect.suspend: A Simple Explanation

could someone explain Effect.suspend to me like im 5 years old? ive read the bit on them in the docs a few times. i think my mental model on effect itself needs shifting abit. it says that it "allows you to defer the evaluation of an effect until it is actually needed", but isn't that what an effect is by its nature? just a reprentation of a computation until its called? by looking at the example at https://effect.website/docs/guides/essentials/creating-effects im struggling to understand why the suspended effect mutates the i value while the standard one doesn't...
Learn various methods to create effects in the Effect ecosystem. Understand the drawbacks of throwing errors in traditional programming and explore constructors like Effect.succeed and Effect.fail for explicit success and failure handling. Dive into modeling synchronous effects with Effect.sync and Effect.try, and asynchronous effects wi...
Creating Effects – Effect Docs
Was this page helpful?