News for hackers. Stuff that matters.
Re:A new approach to error handling by sestep on Tuesday July 30, 2024 @03:28PM (#41113222)
Maybe I'm missing something, but this just seems like a less general construct than algebraic effects; for instance, see the exn effect in Koka: https://koka-lang.github.io/koka/doc/book.html#why-effects

Is there some benefit of this approach compared to algebraic effects?

Re:A new approach to error handling by Yoric on Tuesday July 30, 2024 @04:14PM (#41113659)
Agreed, it's pretty clearly a subset of algebraic effects. In fact, I'm fairly certain that I've seen examples similar to OP as the hello world of algebraic effects a few times.
Re:A new approach to error handling by zokier on Tuesday July 30, 2024 @03:41PM (#41113348)
Implementation simplicity?
Re:A new approach to error handling by sestep on Tuesday July 30, 2024 @04:08PM (#41113591)
Could you shed some light on the degree to which it's simpler? I've heard that algebraic effects are complex but I don't have much of a feel for why that is.
Re:A new approach to error handling by zupa-hu on Tuesday July 30, 2024 @04:59PM (#41114082)
(Author here) Yes, that's correct. It's an algebraic effect elevated to a dedicated language feature.

The benefit is that it is simpler than having full-blown algebraic effects, both to learn and to actually use. Probably not for you, but for most people, and definitely for the non-professional developer kind.