> For a great example of this, see OCaml 5 support for effect handlers. It's basically a generalisation of exceptions, very lightweight and elegant.
A similar approach is being explored for Scala 3:
- https://dotty.epfl.ch/docs/reference/experimental/canthrow.h...
- https://infoscience.epfl.ch/record/290885
- https://github.com/lampepfl/monadic-reflection (https://youtu.be/UmO-f0qTRSU)