import { Effect } from "effect"
const greet = Effect.sync(() => "hello")
const first = Effect.runSync(greet)
const second = Effect.runSync(greet)
// first === "hello", second === "hello"
The same Effect value can be run any number of times — each run is fresh. This is what makes retry, repeat, and concurrent fan-out free: the description is immutable; the runner produces the side effects.
Compare this to a promise, which fires once at construction and caches the result forever — you cannot “retry” a Promise, only retry whatever built it.
Watch out. Re-running for side effects is fine; re-running expecting
shared state to persist between runs is not. Each runSync is its own
world. For state that survives across a single run, see Ref in step 39.
Your turn: call Effect.runSync(work) twice in the test (both stub lines) and confirm the counter reaches 2 — proof that one description produces N executions when handed to N runner calls.