3 ms·
I wonder what error-monad looks like in C++, or C for that matter. here's a rough, probably incorrect demo in python: https://gist.github.com/2653752 https://g
by dustingetz 14y ago
I wonder what error-monad looks like in C++, or C for that matter.
here's a rough, probably incorrect demo in python: https://gist.github.com/2653752 https://gist.github.com/2653752
gives you nice, clean, exception-like error handling that doesn't leak to the wrong level of the call stack, and in a statically typed language the compiler can verify your error handling for you. quite similar to checked exceptions. call stack issues can be fixed with some low level C, or you could even unwind the stack with some exception trickery.