5 ms·
It makes sense that idempotent can have both definitions. Mathematical functions can't have side effects so they have the "normal" definition of f(f(x))=f(x).
by croddin 11y ago
It makes sense that idempotent can have both definitions.
Mathematical functions can't have side effects so they have the "normal" definition of f(f(x))=f(x).
In computer science, with side effects, since state can change, the passage of time could be though of as similar to composition f(x) ... f(x) ~= (f o f)(x) = f(f(x)). This is the line of thinking that gets to monads where successive calls would in fact be f(f(x)) (or f(x).f())
Am I understanding idempotence/side effects/monads right?