4 ms·
Monads are a discovery from category theory.
by epgui 3y ago
Monads are a discovery from category theory.
- CyberDildonics 3y agoThat's great for category theory. 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.
- ChadNauseam 3y agoC++ doesn’t get this treatment when it comes to template metaprogramming, Python doesn’t get it about metaclasses, etc. Every language has tricky parts. The difference is that Haskell’s trickiest part, Monads, are actually very simple. They’re simple enough that they can be explained in a short article, so that causes people to write lots of articles about them.
- chongli 3y agoThis is all true except for the claim that monads are Haskell’s trickiest part. Monads are Haskell’s most infamous part but far from the trickiest. There are a lot of Haskell libraries that make the type system twist itself into a pretzel to achieve some really funky things. See Edward Kmett’s lens library for one example.
- worrycue 3y ago> C++ doesn’t get this treatment when it comes to template metaprogramming 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.
- CyberDildonics 3y agoIn their basic form templates solve an obvious problem in an obvious way. It doesn't make sense to make the same data structure for every type, you want to make the data structure generic and sub in the type every time you use it. 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.
- gilmi 3y agoMonads are a bit like exiting vim. The complexity is exaggerated to the point of a meme, but in reality not very difficult, and they can be quite useful.
- epgui 3y ago> and they can be quite useful 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.
- epgui 3y agoCan you admit that you just moved your own goalposts here? Your claim was literally that monads were invented rather than discovered.
- CyberDildonics 3y agoI said that haskell was invented and not discovered. The person I replied to was comparing calculus to haskell.