Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>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.



The 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: