Algebraic Effects for the Rest of Us
The author ought to look into and write about the Common Lisp condition system, which allows error handlers to invoke restarts at different parts of the  call stack. [1] The long-story-short on them is that they decouple the treatment of exceptional situations (or <i>conditions</i>) into three orthogonal roles: <i>signaling</i> the condition (akin to “throwing”), <i>handling</i> the condition (akin to “catching”), and <i>recovering</i> from the condition (which has no resemblance in popular languages). The signaler, the handler, and the recoverer can be three disjoint bodies of code sitting in different parts of your call stack.<p>Doesn’t have a cool name like “algebraic effects”, and doesn’t have cool operational semantics written out, but it does something quite similar to what the article describes. Here is a little example I cooked up for a Julia programming audience. The code offers an API for computing roots of functions, and has a DIVERGENCE-ERROR condition and a handful of different restarts which handlers of said error can invoke. [2]<p>If you want to see what languages will look like in N years, it’s always wise to see what Common Lisp or Scheme are up to.<p>[1] <a href="http:&#x2F;&#x2F;www.gigamonkeys.com&#x2F;book&#x2F;beyond-exception-handling-conditions-and-restarts.html" rel="nofollow">http:&#x2F;&#x2F;www.gigamonkeys.com&#x2F;book&#x2F;beyond-exception-handling-co...</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;stylewarning&#x2F;lisp-random&#x2F;blob&#x2F;master&#x2F;talks&#x2F;4may19&#x2F;root.lisp" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;stylewarning&#x2F;lisp-random&#x2F;blob&#x2F;master&#x2F;talk...</a>