3 ms·
Monads are not a language feature, they are a library feature.
by jonsterling 13y ago
Monads are not a language feature, they are a library feature.
- gcr 13y agoOk, true. They're certainly much nicer to use if you have nice syntax for them though. :)
- dustingetz 13y agoOnly true in the most pedantic sense. For monads to work, all your code needs to be pure (in the FP sense). So if you want to do anything substantial with monads in an imperative language, you need to rewrite the entire ecosystem of libraries. That would cost quite a bit more money than your average organization can afford ;)
- jonsterling 13y agoAlso has nothing to do with the language, mate. Your argument does nothing but agree with my point :)
- jonsterling 13y agoAlso, you of course do not need purity to get monads to “work”. You can do them in SML or OCaml, for instance, which are not pure by a long shot; by the definition of “pure” which I employ, Haskell isn’t either. Lack of purity is a defect which bites you whether or not you have monads: so if you're perfectly happy dealing with it in your existing code base (like most of us are), making explicit the “monadic” patterns in your codebase will not make it worse, and may improve things a bit.