Outcome-Oriented Programming
michaelmcneil.com
michaelmcneil.com
Briefly, monads function as a kind of "overloadable semicolon". For error handling it lets you say that if any step fails then you abort the rest of the steps and return whatever the error code was.
The "returns multiple cases" one can also be handled using the List monad and its relatives, which do non-determinism. At the very least, the type system forces you to consider the possibility.
I've read and re-read the first page of Google results about monads at least ten times, and I never really "got" it. Maybe I'm just dumb- but it seems to me that the problem remains unsolved.
Yeah, and the year after that will be the year of Lisp and Linux.
You have a function that returns an enum and you have to match all the different states of the enum in your handling code. The ones that call your given function have to do the same and so on and so on.
You can still have bugs in this model if I recall, they're just harder to have, I think. Admittedly, this is getting outside of my area of recent experience and expertise, I just swear I've read about something like this before.
Oh god please no.
Building a nontrivial app in node is already a nightmare.
In Clojure I got almost to the point where I can write and reuse almost any layer of my application, I need to connect with Mongo, check, I need to authenticate an user, check, I need to connect with Postgresql, check...
In the next app, if I would need to connect again to mongo I will just need to import the relevant module...