Hacker News new | ask | show | jobs
by tel 3560 days ago
Right, so I think where we're disagreeing is that the casual ones are subtly wrong. I think they're often pretty significantly wrong and that this post was essentially poking into that notion. When purity gets on the table lots of divergent ideas tend to be tossed out to nail it down and a lot of confusion results.

The best casual definition I know of is "a pure function, f, is one such that all variation in the function's result arises from variation in its input and that all information from the function's call is contained in its result: throwing the result away is equivalent to having never called the function"

A bit of a mouthful, but it's intuitive and arises from a formal definition that works out pretty nicely. Otoh, it's complex enough that it's rarely used in its complete form. Finally, it's still subtle enough that it can lead to questions about what side effects are exactly (non-termination is an immediate example).

Anyway, I just want to continue to suggest that understanding pure functions, really, is a more difficult task than people make it out to be.