4 ms·
I really liked this post. It reminds me of a similar post by James Hague[0] A number of people seem to be hung up on what is meant by FP advocates saying "ord
by lliamander 11y ago
I really liked this post. It reminds me of a similar post by James Hague[0]
A number of people seem to be hung up on what is meant by FP advocates saying "order doesn't matter". In all the literature I have read when I first learned about FP it seemed pretty clear to me that it meant "function composition is associative", not "function composition is commutative".
But whether this is obvious is beside the point. The hypothetical confused programmer is merely a rhetorical device to set the reader up to think more deeply about how they handle state. FP teaches us to push state changes to the boundaries of the system. OK, once it is there, now what do we do with it?
We handle it declaratively[1]. That's what treating the updates as data allows.
[0]http://prog21.dadgum.com/189.html http://prog21.dadgum.com/189.html
[1]https://awelonblue.wordpress.com/2012/01/12/defining-declarative/ https://awelonblue.wordpress.com/2012/01/12/defining-declara...