Are idempotent functions the same as pure functions? -
i read wikipedia's explanation of idempotence. know means function's output determined it's input. remember heard similar concept: pure function. google them can't find difference...
are equivalent?
an idempotent function can cause idempotent side-effects.
a pure function cannot.
for example, function sets text of textbox idempotent (because multiple calls display same text), not pure.
similarly, deleting record guid (not count) idempotent, because row stays deleted after subsequent calls. (additional calls nothing)
Comments
Post a Comment