Re:What Monoids teach us about software
by smcl on Wednesday September 13, 2017 @01:25PM
(#15240472)
People are awful at explaining Monad-related concepts. I think everyone starts with a reasonable explanation and then tweak it to be more succinct until they end up "a monad is just a monoid in the category of endofunctors"
[ Parent
| on HN ]
Re:What Monoids teach us about software
by tw1010 on Wednesday September 13, 2017 @01:49PM
(#15240719)
This article is about Monoids, not Monads. Monoids are simple. Just imagine a bunch of things, and imagine you can "combine" any arbitrary thing to another thing. The combination has the property of being associative (whatever) and you're only allowed to called it a monoid (otherwise convention says you need to call it a semigroup) if there is also an item (the "identity" or "neutral" element) which when you combine it with any arbitrary item, produces that same item as a result.
Common examples are: strings which you're allowed to combine with concatenation (with the empty string being the "neutral" element). Integers with addition as the combiner is also a monoid that also has a few additional named properties (like commutativity and existence of inverses) but they're still monoids.
Re:What Monoids teach us about software
by umanwizard on Wednesday September 13, 2017 @02:54PM
(#15241421)
By "monad-related concepts" do you just mean abstract algebra? Otherwise, how are monoids and monads related, other than that they are both algebraic structures?
Re:What Monoids teach us about software
by smcl on Wednesday September 13, 2017 @04:21PM
(#15242203)
My comment was pretty poorly written, and is probably better understood in terms of just "explanations of things starting with mon-" :-D
The concepts aren't tough, people are just pretty bad at putting themselves in the shoes of a learner, and throw bizarre over-complicated descriptions and examples into the mix when explaining them. The description I gave is someone's tongue-in-cheek stab at these which has stuck with me (unless I'm horrendously off and that is actually someone's legit attempt to describe monads)