3 ms·
Monads seem to be useful for ansync code and error handling. I hate that monads get all the press when ADTs are the real winner when it comes to FP.
by foobar_ 7y ago
Monads seem to be useful for ansync code and error handling. I hate that monads get all the press when ADTs are the real winner when it comes to FP.
- mumblemumble 7y agoLINQ is another clear win for monads. There is more to LINQ than monads, of course, but they contribute to the power of the library. I'm also fond of of the data generation DSLs in property testing libraries, which tend to lean heavily on monads. I continue to find that, outside of lazy functional programming, where you need them to live, monads are at their best when they're used in understated ways where the pattern may not even be mentioned by name. All too often, they end up feeling more like something Rodney Dangerfield's character from Caddyshack would use to play code golf.
- jolmg 7y agoThere are a lot of monads that don't deal with async code or error handling: Reader, Writer, State, Conduit, Parsec, etc.
- dreamcompiler 7y agoMonads are not about asynchrony or side effects or error handling. They're about uniform ways of expressing composition, which subsumes all the above. Monads are not even really about FP; they're just more obviously useful there. And without good static typing many monads are almost more trouble than they're worth, so I guess I agree with your last sentence.