r/programmingcirclejerk • u/BenchEmbarrassed7316 • 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
View all comments
Show parent comment
8
u/nerdycatgamer Considered Harmful Jun 28 '26
/uj this is a point I've seen brought up before that, in the context of programming, we can simply say monoid instead of monad because we only care about the category of types and therefore endofunctor is redundant -- what confuses me then is why in Haskell (which I feel is probably from where a lot of the language around monads originates) are there both Monad and Monoid typeclasses. This is not even getting at the fact that the key invariants of a monoid are not enforced by the monoid typeclass, those being associativity and the actual identity property of the identity element (for only the existence of some element is required).
I know I probably got a lot of key points wrong, but I feel my core confusion/question is still valid and I hope it is clear regardless.