2 ms·
Associative arrays form a monoid, so this code is (perhaps surprisingly) a special case of the monoid library. It has been awhile, but I remember not including
by KirinDave 9y ago
Associative arrays form a monoid, so this code is (perhaps surprisingly) a special case of the monoid library.
It has been awhile, but I remember not including a version like this because it's a bit intense to throw a sort (either implicit or explicit) into this without even commenting on it.
- imtringued 9y agoYou can form a monoid with almost everything. It'S not a very interesting concept that requires more attention than maybe reading the definition. These blogposts are pointless in my opinion. The title makes as much sense as "Overthinking cooking with edibles".
- KirinDave 9y agoMonoids are certainly not the most "interesting" thing, but neither are arrays, or even sets. But they're quite important and useful in a parametrically polymorpic world. That's why it's worth introducing them to people new to FP. Ultimately, these sorts of posts are feeders to conversations about other bigger abstractions like Functors. The title and the post both grant that for fizzbuzz as asked in many settings, but without a simple domain these conversations tend to explode in complexity. So there it is.