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

Popular posts from this blog

sql server - python to mssql encoding problem -

java - SNMP4J General Variable Binding Error -

c# - BasicHttpBinding equivalent CustomBinding using WCF Client and PHP WebService -