Really good overview of functional programming principles and how they are implemented. Not sure I got the bridge part and will need to review, but the idea of creating a functional domain and then reaching to the outside (side effect world) that we are paid to affect is clear.
Immutable data structures
functions with a given output always produce the same output. If input is 2 the output is always 4. If input is 7 the function output is always 21. No state changes.
Therefore, functions are data (output) and can manipulated as data.
Long list? how do we change? We make copies. What if list is 1 million. Then we create a tree of data chunks that are assembled into the 1 million list. So instead of needing to copy the entire list, we just copy the appropriate chunk.
But this doesn't work when we have a counter
Side effects, anything that isn't computing an output from an input. Plus all info needed to process input needs to be contained within the function. Accessing a global variable outside the function creates an impure function. It relies on something that can change that's outside the function. If that changes, then the same input giving same output rule will break.