Hacker News new | ask | show | jobs
by markfsharp 3660 days 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.
2 comments

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).

Yeah, I could go along with that.
Are there any terms/concepts in math/CS that are related to or similar to "idempotence"?
I think in this case, referential transparency means the same thing. That is, produce the same output given the same input, every time.
Got it, thanks.