4 ms·
The article is completely wrong. The monoid operation is not array concatenation (wtf?) but the monad join operation. Here is a correct explanation: https://st
by devit 5y ago
The article is completely wrong. The monoid operation is not array concatenation (wtf?) but the monad join operation.
Here is a correct explanation: https://stackoverflow.com/a/3870310 https://stackoverflow.com/a/3870310
- epolanski 5y agoThat's actually the only correct part of the blog, arrays form monoids via concatenation and empty arrays. That's algebra tho, which is very relevant to functional programming (monoids capture the essence of composition) in general, but not the right monoids in category theory.
- devit 5y agoOf course they form a monoid with concatenation, but it's not the monoid that makes the monad (which should be pretty obvious since concatenation is not used in the monad operations for arrays).
- lkitching 5y agoThe type of join for arrays is Array (Array a) -> Array a which should concatenate all the inner arrays together.