top | item 11877530

(no title)

markfsharp | 9 years ago

Pure functions, i.e. that are 1) idempotent 2) have all their arguments passed in 3) cause no side effects as a by product of evaluating the function are fundamental to functional programming.

discuss

order

louthy|9 years ago

But not fundamental to the definition of a functional language. F# isn't pure, but most would call it a functional language - so purity is surely not 'fundamental' - in fact most functional languages aren't pure.

That's why I prefer to stick to the 'expression oriented' concept, it seems to be the thing that captures most, if not all, functional languages. But I guess just like there are plenty of people that wouldn't call Java OO (and would prefer the Alan Kay definition), there are plenty that will disagree with any definition of 'functional'

(preparing for the inevitable 'functional first' comment).

markfsharp|9 years ago

Yeah, I could go along with that.

vram22|9 years ago

Are there any terms/concepts in math/CS that are related to or similar to "idempotence"?

phyllostachys|9 years ago

I think in this case, referential transparency means the same thing. That is, produce the same output given the same input, every time.