3 ms·
I believe you can't have that happen universally since then you don't get the benefit of having exceptions bubble at all—you're just de facto operating in an er
by tel 11y ago
I believe you can't have that happen universally since then you don't get the benefit of having exceptions bubble at all—you're just de facto operating in an error monad.
On the other hand, if it's not universal then you have to set boundaries where the exception to value transition occurs and this is "just" a catch block.
- coldtea 11y ago>I believe you can't have that happen universally since then you don't get the benefit of having exceptions bubble at all—you're just de facto operating in an error monad. I was thinking something like you get an Optional, and you check it. If you use it without a check (e.g. something like "try" in Rust), and it's an error value, then it "explodes" again and bubbles up.
- tel 11y agoThe mechanics of that are easily captured with a monad, but baking it into the natural semantics of the language would be a neat experiment, I agree.