Hacker News new | ask | show | jobs
by DougBTX 3565 days ago
Is that definition of pure closer to mthq's definition or the one in the article? I'm not sure.

It says "same argument value(s)", but how does that apply when the argument is a function? The article seems to be saying that if the same argument is passed in every time, then the function is only pure if it returns the same value every time, regardless of whether the argument is a pure function or not.

1 comments

A pure function can't call a non pure function. So you can pass in a non pure function so long as you don't call it.