Re:Is your JavaScript function actually pure?
by grenoire on Tuesday September 20, 2016 @07:19AM
(#12538612)
Is it then the variable (or the variable accessor) that is impure, or the function that is impure?
[ Parent
| on HN ]
Re:Is your JavaScript function actually pure?
by 14113 on Tuesday September 20, 2016 @10:55AM
(#12539971)
The variable accessor is a function of type Variable -> Field, which the function sum is calling. Because of that, the function sum is impure, as it's calling an impure function. I would argue that the object is just a wrapper around a function, and in essence making the sum function implicitly higher order, as you're passing it a function to retrieve a value, rather than an actual value.