by eMSF · 2y ago · 0 comments
I agree. It's lunacy. just be explicit and use functions or equivalent like literally every other language.
I believe Rust has adopted similar idioms. I’ve heard the overall idea referred to as Railway-oriented programming.
In C++ you could implement it with exceptions, though they bring in a bunch of their own baggage that you don’t have to deal with when using monads.