2 ms·
> Throwing Promises for Suspense is basically Algebraic Effects I wish Dan Abramov hadn't made this analogy[0], they're nothing like algebraic effects. The cor
by lhorie 5y ago
> Throwing Promises for Suspense is basically Algebraic Effects
I wish Dan Abramov hadn't made this analogy[0], they're nothing like algebraic effects. The core idea behind algebraic effects is more similar to something like dependency injection if it was generally possible to "deasync"[1] things in JS, except it leverages dynamic scoping instead of lexical scoping. The Suspense thing is closer to those jokes where the punchline is something along the lines of the programmer saying "have you tried to restart it?"
[0] https://overreacted.io/algebraic-effects-for-the-rest-of-us/ https://overreacted.io/algebraic-effects-for-the-rest-of-us/
[1] https://www.npmjs.com/package/deasync https://www.npmjs.com/package/deasync
- azangru 5y ago> I wish Dan Abramov hadn't made this analogy[0], I bet it wasn't Dan who came up with this analogy. My bet is on Sebastian: https://twitter.com/sebmarkbage/status/941214259505119232 https://twitter.com/sebmarkbage/status/941214259505119232
- Zababa 5y agoFurther evidence of this in this blog post by Dan Abramov https://overreacted.io/algebraic-effects-for-the-rest-of-us/ https://overreacted.io/algebraic-effects-for-the-rest-of-us/