3 ms·
There is no reason to use state at all here, let alone the state of the world. In FP you just do: x + 1 Moreover, this example is totally meaningless, bec
by epgui 3y ago
There is no reason to use state at all here, let alone the state of the world. In FP you just do:
x + 1
Moreover, this example is totally meaningless, because it doesn't feature anything that is different about FP and the imperative style at all.
- c_crank 3y agoy = x + 1 is not dealing with state. Supposing there was a desire to have x = x + 1, the simple way of doing this is x = x + 1, and the complicated way is to do world = Increment(x, world).