Comment

Comment by scalaisneat

because it is declared as an effect - and implements a handle.

Think of it more like an interface. It turns out that many common patterns - async, IO, yielding can all be expressed with a handle - and the effect can be represented in the signature.

This allows the code to have which effect its ran in, at runtime - other commenters pointed out its very similar to dependency injection.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton