3 ms·
I find these introductory articles ultimately misleading. Monad is never hard, just like group is never hard, vector space is never hard, lattice is never hard,
by hintymad 7y ago
I find these introductory articles ultimately misleading. Monad is never hard, just like group is never hard, vector space is never hard, lattice is never hard, manifold is never hard, and on and on. What's hard is to understand not just one single concept but layers of webs of abstract concepts, along with all the theorems and ingenious ways of applying them. What turns people away is not the difficulty of monad or functional programming in general, but lack of incentives. Why don't we just be upfront and tell people: XXX is hard, but you know what? If you master it, here is what you will get out of it.
- somebodythere 7y agoBecause telling someone "XXX is hard but you should learn it" doesn't actually get the person closer to an understanding of XXX. Telling something "XXX is really useful and you've been putting off learning it because most of the material is inaccessible, so here's a gentle introduction to the concepts" does, though.
- yingw787 7y ago@hintymad thanks for sharing! For me, monads seemed hugely difficult to learn, and so I never got started with them at all. Had I just known that they were not as hard as I thought they were (which I think is different from not hard) I might have started earlier. I’m hoping that by sharing some of my understandings I can help people avoid some of my own hesitation. What I really like about the HN community is the notion of shipping even if you’re embarrassed by it, because the future good or bad is built by the people who show up.
- recursive 7y agoIt only seems not-hard for people that already understand them. Here's where the post shows just how simple monads can be. > A monad is a data type (e.g. int) that encapsulates some control flow (e.g. try/catch). But... I'm already lost. How would an integer "encapsulate" control flow? Like different integer values would represent different errors that could occur? Or you could use integers as a representation for a language that has try/catch as a feature? Even in this simplest case, if you don't already grok monads, it's somehow not illuminating for me. YMMV
- setr 7y agothat's just poor wording -- the first example wasn't supposed to be linked to the second example; A better sentence is probably A monad is a datatype (e.g. Either<T,U>) that encapsulates some control flow (e.g. if T != null return T else U) if I understand it correctly
- johnisgood 7y agoSo what will I get out of it once I master it?