3 ms·
This post really needs to explain why plausible alternative solutions (ideally ones used in real world open source projects) which are not monoids rapidly lead
by archgoon 11y ago
This post really needs to explain why plausible alternative solutions (ideally ones used in real world open source projects) which are not monoids rapidly lead to having to deal with increased complexity. Otherwise, it's just bringing in a lot of terminology waving their hands saying "We came up with a solution that let us have mutiple extensions!" which, on the surface, seems pretty boilerplate.
- tome 11y agoImagine you've got ten pieces you need to stick end to end a b c d e f g h i j How many ways can you do that with a binary operation? i.e. how many ways can you completely parenthesise that expression. e.g. ((a (((b (c d)) e) ((f g) h)) i) j) I haven't worked it out exactly, but I think it's about a trillion. On the other hand, suppose your binary operation is associative. How many different ways are there now? Effectively one. That's a huge reduction in complexity. The notion of associativity is extremely useful in developing composable programs.
- radicality 11y agoAre you sure of that? Isn't the answer to your question the Catalan numbers, for which this case the answer is 4862?
- tome 11y agoI'm not sure at all! My calculation came out very wrong, and a quick sanity check should have told me it's implausible that it's in the trillions. Anyway, 4862 times is still a substantial complexity reduction. Thanks for the correction.
- bjacks 11y agoI totally agree with this, it was like 'here's a solution using category theory', but what were the alternatives? How is this useful/applicable to me, and why should I learn category theory?
- theoh 11y agoIt's worse than that, I think. They had some code that expects input in a certain format, they wanted it to accept input in a variety of other formats, and category theory was apparently necessary to come up with the idea of a format converter from each new format to the original format. Extremely basic. Trying to pretend it's a CT application is just pretentious in the extreme.
- twic 11y agoAs far as I can tell, this is what category theory is for. It lets you take some quite basic structure or piece of work, and describe it in rigorous, impressive-sounding terms.