loading...

re: Function vs Object VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Closure without mutation or re-assignment ("pure"): const addSome = (x) => (y) => x + y; const addFive = addSome(5); addFive(1) === addFive...

Re state: in pure FP I think we mean a "named" piece of data whose instances get changed over time:

go :: Int -> Int
go 0 = 0
go s = s + go (s-1)

Here s can be thought of as state, even though specific bindings of s don't change.

We observe state over the course of computation.

Code of Conduct Report abuse