3 ms·
Let's compare how Wikipedia starts the definition of a "monad": "a monad [...] is an endofunctor (a functor mapping a category to itself), together with two na
by microtherion 7y ago
Let's compare how Wikipedia starts the definition of a "monad":
"a monad [...] is an endofunctor (a functor mapping a category to itself), together with two natural transformations required to fulfill certain coherence conditions."
vs. "encapsulation":
"Encapsulation [...] is the bundling of data with the methods that operate on that data, or the restricting of direct access to some of an object's components."
Are you seriously going to argue that those concepts are equally arcane to somebody not familiar with the underlying paradigm?
- mbrodersen 7y ago> Are you seriously going to argue that those concepts are equally arcane to somebody not familiar with the underlying paradigm? Most definitely! I have tried to teach C# to a non-programmer friend of mine and his brain exploded when I tried to teach him about classes. However I have taught a few programmer friends what a Monad is in a few minutes. The problem with the Wikipedia page is that it is correct but targeted at somebody who understands category theory. Which is useless if you just want to learn how to use it in (say) Haskell.
- tome 7y agoYou looked up the wrong definition. "In functional programming, a monad is a design pattern[1] that allows structuring programs generically while automating away boilerplate code needed by the program logic."