3 ms·
Glad I could help! One last thing: the core idea of functional programming is mapping state to state, the same way a transform matrix maps a vector to another
by angersock 12y ago
Glad I could help!
One last thing: the core idea of functional programming is mapping state to state, the same way a transform matrix maps a vector to another vector. So, to accomplish something, you string together functions to map you from the state you have to an ultimate state that you want.
For something like calculating the average of a set of numbers, this would be:
[ set of numbers ] -> function maps from the "set of numbers space" to the "sum of all numbers in a set space" --> function that maps from the "number space" to the "number space scaled by a value (here being the number of original numbers in the set)" --> your final mean