3 ms·
I really recommend this article about designing a graphics library with a lot of monoid structures. http://repository.upenn.edu/cgi/viewcontent.cgi?article=177
by mbrock 9y ago
I really recommend this article about designing a graphics library with a lot of monoid structures.
http://repository.upenn.edu/cgi/viewcontent.cgi?article=1773&context=cis_papers http://repository.upenn.edu/cgi/viewcontent.cgi?article=1773...
For me it gets interesting when you compose monoids, and that article has several elegant examples.
Otherwise I think the monoid structure is not super interesting in itself, but it's a really useful building block when thinking of software "algebraically", which to me is the most interesting aspect of Haskell as a programming tradition.
As for commutativity, I'm not sure how to answer. The monoid notion is useful in both commutative and noncommutative settings. When composing monoids one might be commutative and others noncommutative (like, say, a tuple of int and list of strings, the int being a total size and the strings being file names).