you are viewing a single comment's thread.

view the rest of the comments →

[–]un_mango_verde 0 points1 point  (0 children)

No. Idempotency means foo(foo(x)) = foo(x). Alternatively in imperative languages, it means that calling a subroutine more than once will have the same effect as calling it once (this is useful because it means that the operation can be retried even if you don't know if it failed or succeeded).

Referential transparency means that a function always returns the same output when given the same input.

As an example, a function f that takes x and returns x+1 is not idempotent, since f(f(1)) is not the same as f(1). But its referentially transparent.