2 ms·
> If you want to keep track of world-current, then you need a variable that changes from world-0 to world-1 somewhere. Putting on my FP hat: if you need the st
by bonesss 9y ago
> If you want to keep track of world-current, then you need a variable that changes from world-0 to world-1 somewhere.
Putting on my FP hat: if you need the state of the current world then somewhere you need a side-effect free function that can report that state. If you're managing that state over time then you'll need other functions to handle that stream of immutable data.
Conceptual mutability very often isn't a change of data, it's a change in usage/reporting context.
And since we're in FP land we could compose those input and handling functions together and splay them across infinite vectors in both directions creating infinite functional chains of potential data interactions that are only calculated on demand based on incoming data. We can be highly confident that those calculations will scale from 1 to 1 million CPUs/machines. We can be highly confident about state-based testing of future states (a la Y2K bug). We can formally verify system behaviour and the underlying data flow. We can also safely and logically match those flows to new and interesting transformations through exhaustive pattern matching with guarantees that we are not impacting the current system behaviour...
Granted: there are likely mutable variables somewhere in that turtle-stack, but the overall systems relationship to state will not be impugned by them as long as they are appropriately contained.