3 ms·
Taken to its logical extreme, you get Algebraic Effect Handlers: http://math.andrej.com/2012/03/08/programming-with-algebraic-effects-and-handlers/ http://math.
by brandonbloom 10y ago
Taken to its logical extreme, you get Algebraic Effect Handlers: http://math.andrej.com/2012/03/08/programming-with-algebraic-effects-and-handlers/ http://math.andrej.com/2012/03/08/programming-with-algebraic...
The idea is a generalization of try/catch in which all effects are accomplished through handler blocks that receive a continuation. Just like when you make a kernel call, your program is a continuation given to the kernel. Usually the kernel calls you back once, but some syscalls return twice (fork) or not at all (abort) by manipulating processes.
Coupled with reusable handler block bundles, you can wrap a "container" around any expression in your entire program.