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

It looks like exceptions (write the happy path in direct style, etc), but with exceptions, there is a `catch`. You can look for it and see the alternate path.

What might be a good way to find / navigate to the effectual context quickly? Should we just expect an IDE / LSP color it differently, or something?



There's a `catch` with effects as well, though, the effect handler. And it works very similarly to `catch` in that it's not local to the function, but happens somewhere in the calling code. So if you're looking at a function and you want to know how that function's exceptions get handled, you need to look at the calling code.


This is the case anytime errors are propagated to callers instead of handled locally, which is probably most cases.


Just to clarify because the grammar is a bit ambiguous in your comment: which case do you see as the common case? I suspect in most cases, people don't handle errors where they are thrown, but rather a couple of layers up from that point.


> I suspect in most cases, people don't handle errors where they are thrown, but rather a couple of layers up from that

Agreed, that's the point I was trying to make.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: