3 ms·
I feel like there's a whole genre of essays (red vs green functions is the worst example) that could be summarised as: * Monads naturally arise out of many pro
by moomin 3y ago
I feel like there's a whole genre of essays (red vs green functions is the worst example) that could be summarised as:
* Monads naturally arise out of many problems in programming.
* But I don't want my language to support monads.
* So here's something you can do to stay in denial about how much you need monads.
At least this example only involves writing hard-to-analyse code and doesn't lead to you trying to invent green threads.
- mrkeen 3y agoThe kicker here is that the author implemented a functor and called it a monad. So of course readers are going to think "the monad approach" is confusing and stay away.
- voxl 3y agoI mean even if you implement a more standard Monad interface plenty of functional programmers still find working with Monads to be ugly. It's really not a solved area.
- moomin 3y agoI’ll accept that. But do notation is the closest thing to sensible we have, whereas most of these articles are just constantly trying to chip away at part of the problem in the hope that they’ll be able to make the whole mountain disappear one stone at a time. And to date, I don’t find the evidence promising that they can. I’m not wedded to stuff like monadic state, I think that might be a bridge too far for regular programming (and besides which, it doesn’t really generalise anyway) but that still leaves a large family of issues that we’re all aware of but trying to dodge.