I don’t know any Haskell at all, and it seems to be the only language out there where people think monads are a thing you need to learn, so I definitely have no motivation to learn them outside of curiosity.
But I am curious about them, enough to read every tutorial I come across about them. But I still have no idea what they are.
You sound like a kind and curious person. If you ever want a one-on-one walkthrough please reach out to me (email in bio). Everyone deserves the chance to understand something if they want to.
Explaining things to people that already knows them is always easy.
I'd say that your list is full of things that have practical examples when you consider how real, physical computers work. Boolean logic can be shown by example by showing physical transistor circuits, and I'd argue that people can understand them quite easily. Pointers/variables can be shown by explaining how memory addressing works on real machines, and what CPU instructions correspond with the actual code you're writing.
Monads however, seem to be this purely abstract mathematical concept that comes from CS-as-a-math-discipline, which although useful, requires you understand ton more theoretical background before you can approach it. At least that's my experience -- I still don't understand them and every tutorial I've read either makes them look like magic (ie. doesn't actually explain them) or tries to take a mathematically rigorous approach and I get lost in the weeds.
I know intuitiveness is very subjective, but I'd wager that by numbers, many more people are able to understand pointers/mutable variables/macros/boolean logic/etc more easily than they can Monads.
Young man, in mathematics you don't understand things. You just get used to them.
—- John von Neumann
Honestly I think a lot of effort is wasted starting with this stuff rather than more motivated examples... But the interest is the harder thing to come by, so at least they're learning something.
You could basically rephrase it as “you don’t need a lot of math, you just need a lot of math”.
Well, if they were, all those people wouldn't be trying to understand them.
They are applied on Haskell (and Javascript, Rust, C#... but they are way more visible on Haskell). Write some Haskell and you will get them.
But, well, I don't have any reason for you to do that. You just asked how, and I gave you a way. If you don't have any interest in learning it, there's absolutely no problem, but posting "I never really tried, but that thing is bad because I haven't learned it already" FUD is pretty bad.
But so far, no monad tutorial has made a good case for why they’re actually useful, other than for learning Haskell. And most advice for how to learn them sounds exactly like what you said: “oh if you still don’t get it, you just need to write more Haskell.” You can see why that’s a bit of a disappointment, right?
Basically, you have people making this argument:
- monads are important outside of Haskell
- to understand why, you have to learn them
- to learn them, you should write Haskell
Which I’m sure you can understand comes off as a bit unconvincing.If you want to use a language to program, knowing them will help you with approximately nothing, because most languages either have awful ergonomics for that kind of abstraction or bring them on much more limited ways that you are better learning how they specifically apply to the language than the general concept. If you learn the general concept, the specific cases will be easier, but unless you plan on learning several languages, it's not worth it.
Anyway, one large exception is if you plan on doing heavily abstract C# libraries. The C# support for monads is almost as general as Haskell.
http://www.jerf.org/iri/post/2958
https://philipnilsson.github.io/Badness10k/escaping-hell-wit...
The first one I think cuts through all of the crap surrounding them. They're just a design pattern. And the second one helps motivate them, showing the many contexts where the design pattern many apply.