Haskell is not a discovery of something that already existed. It isn't the only programming language out there. There are dozens of examples of other languages that people use more easily. The problem was something invented, not something that has to do with the underlying principles of programming.
If there are easier ways of teaching calculus, maybe those should be used. Actually that is happening now as youtube videos and web pages help visualize concepts.
If most people are confused why they're in a programming language, maybe it's time to admit that a language is influential but not made for general purpose productivity.
Quite sure a lot of people hate C++'s template programming.
> They’re simple enough that they can be explained in a short article, so that causes people to write lots of articles about them.
Or ... there are a lot of articles because people keep finding new ones to read because they still don't get it after reading the previous 100 articles.
The extremes of template meta programming are self imposed by people being fancy while writing libraries and the value is questionable. On top of that no one thinks that C++ templates are the ideal way to do complex meta programming.
That's a bit of an understatement, seeing as it's... I mean is it even possible to write a non-trivial application without accidentally implementing a monad?
Most people write monads all the time, and then their head explodes when someone calls it by its name.
I agree. It’s very important.
It wasn't invented as a set of restrictions, it was just just discovered and formalized.
That’s a bit too casual of a dismissal of an active, major branch of philosophy of mathematics which holds that all mathematics is invented. For fun, and what I take as evidence supporting that argument, look up Michael Penn on YouTube to see how nonstandard analysis works and how you can define the operations of calculus in vastly different ways than you might have learned in school.
The main difference between calculus and monads is that the former traditionally belongs to the domain of analysis and the latter to algebra. That monads haven’t taken off to the same degree is a matter of luck. The vast majority of mathematics has found no use whatsoever outside of pure mathematics.
Finally, I want to say that I think it’s a mistake to think of monads as some set of restrictions that Haskell’s designers put in place to keep people out, like some twisted “you must be this tall to ride the rollercoaster” gatekeeping. They discovered an algebraic pattern in a bunch of commonly used data types and decided to make it into a type class. For them, it solved a major problem of the language at the time: how to deal with effects in a language that uses lazy evaluation.
This is the problem. You keep talking about "philosophy of mathematics" and I'm talking about programming.
Finally, I want to say that I think it’s a mistake to think of monads as some set of restrictions that Haskell’s designers put in place to keep people out, like some twisted “you must be this tall to ride the rollercoaster” gatekeeping.
I don't know if anyone thinks that. It just isn't useful to write programs with an arbitrary albatross around your neck because someone else is obsessed with philosophy and set theory.
You made a specific claim that calculus was discovered but that monads are invented. Are you walking back that claim? Fine.
It just isn't useful to write programs with an arbitrary albatross around your neck because someone else is obsessed with philosophy and set theory.
I've tried to engage with you in good faith but now it appears that you're just concern trolling. The article is an educational piece about monad transformers. Nowhere is it implied that you, specifically, need to use Haskell in your work. If you can't see why monads are useful, why not ask about that?
No I didn't, I said haskell was invented.
Are you walking back that claim? Fine.
Quote me where I said that.
I've tried to engage with you in good faith
You haven't engaged in the thing that matters: programming. You went off on tangents about philosophy and monads and set theory and pure mathematics, when my whole point is that they don't help the vast majority of programmers write programs.
Nowhere is it implied that you, specifically, need to use Haskell in your work.
I don't. I tried it and it was interesting but not useful.
If you can't see why monads are useful, why not ask about that?
My point is about the larger issue that after 30 years, people are still trying to explain step one of this language. In that time entire other languages have exploded and withered. At some point the expectations that this is healthy needs to be looked at. I like that haskell exists, but it isn't overall a good tool for making software.
Haskell doesn't impose monads on a more fundamental notion of computation that other languages expose directly, which is how I interpreted your comment; rather, other languages force a particular monad on you at the language level, whereas Haskell lets you choose your monad and even mix and match different monads that suit your program. This does introduce some complexity in exchange for the additional flexibility, and people may reasonably differ on whether that flexibility is worth it, but the complexity results from exposing something more ‘fundamental’, according to our current theories of computer science, that other languages hide from you.
You say that, but they only seem to come up when dealing with haskell.
This is similar to structured loops and function calls (not GOTO), which are in computations that we care about, regardless of the implementing programming languages. Some languages do not name and reason about them (e.g., Assembly, Turing Machines).
While it is possible to program without raising the level of discourse, this is discouraged (considered harmful), as it lacks safety, hurts productivity (developer velocity/experience), and scales worse.
> > when you start considering effectful computation at a deep level, monads come up pretty quickly
> You say that, but they only seem to come up when dealing with haskell.
"when you start considering structured computation at a deep level, loops and function calls come up pretty quickly"
"You say that, but structured loops only seem to come up when dealing with high level languages."
This situation, where a higher level programming language delivers more power (in this case, scales with better developer velocity/experience) but a lower level programmer resists, has been observed many times. Paul Graham calls this the Blub Paradox [1].
What's so great about Lisp? And if Lisp is so great, why doesn't everyone use it?...
I'll begin with a shockingly controversial statement: programming languages vary in power.
... But when our hypothetical Blub programmer looks in the other direction, up the power continuum, he doesn't realize he's looking up. What he sees are merely weird languages. He probably considers them about equivalent in power to Blub, but with all this other hairy stuff thrown in as well. Blub is good enough for him, because he thinks in Blub.
And using a powerful high level language is "The Secret Weapon" behind the success of Viaweb [1]. Haskell is also a secret weapon for those who know how to use it.[1]: http://www.paulgraham.com/avg.html "Beating the Averages"
our hypothetical Blub programmer
This is all patronizing rationalization to believe that people aren't picking someone else's favorite language because they "just aren't smart enough to get it".
Programming is hard enough without constantly trying to make languages themselves a silver bullet. Fancy macros, fance meta programming, 'pure mathematics' etc. never equals productivity over the long term. Library writers can get away with it, but simplicity wins overall because people can focus on making programs and making tools surrounding the language.
Lisp and Haskell were influential, but that doesn't make them good tools by modern standards. They had ideas that made it into other programming languages and that's enough. They did their jobs. Haskell has major programs with controlling order of execution because it pretends it can be abstracted away.
"The Secret Weapon" behind the success of Viaweb
Haskell users always talk about the same handful of programs that no one would have heard about if they weren't made in haskell.
Meanwhile 90% of software that people actually use is basically made in C++, python and javascript. The languages aren't perfect, but when people sit down to program they can move past the language and actually write software.
You share good company with this observation. Philip Wadler (who put the monads into Haskell) often talks about functional languages having been discovered, rather than invented.
Haskell is System F (The polymorphic lambda calculus) with the Hindley-Milner type system. (Both Hindley and Milner independently discovered it.)
Curry and Howard observed that this type system corresponds to 1st order logic - types are propositions and programs are proofs, e.g.
modus ponens:
P implies Q
P is true
Therefore Q must also be true.
H-M 'App' rule:
f has type P -> Q
x has type P
Therefore f(x) has type Q.
You don't have to dig far into Haskell to find the 'discovered' stuff.