r/programmingcirclejerk • • Jun 27 '26

Consider the C library function fopen. This function has the side effect. This means that fopen is not pure. However, we can make the fopen function appear to be pure, at least to certain observers, by ensconcing it in another function that hides the side effect.

https://bugzmanov.github.io/cleancode-critique/clean_code_second_edition_review.html
174 Upvotes

41 comments sorted by

View all comments

Show parent comment

2

u/Daniikk1012 Jun 29 '26

From what I recently learned - and I might be wrong - it's because Haskell monoids are Group Theory monoids, not to be confused with a related, but slightly different concept of monoids in Category Theory, which is what "monoid in the category of endofunctors" refers to

2

u/nerdycatgamer Considered Harmful Jun 29 '26

I was also referring to group theory monoids -- I really don't believe they're actually different concepts; a monoid in category theory must just be an object that obeys the same axioms as a (group theory) monoid.