4 ms·
Mutating getter? Sounds like a generator function that yields. Or a pseudo random number generator implemented with a monad (WorldState, Value). Or any tail-rec
by diegoperini 7y ago
Mutating getter? Sounds like a generator function that yields. Or a pseudo random number generator implemented with a monad (WorldState, Value). Or any tail-recursive non-void function that carry state without loss?
I'm definitely not an expert but aren't irrational numbers are the best examples to show that these types of constructs already exist in math? You can't calculate them in finite amount of time. You use an analytical formula or series expansions to get the nth term instead.
- ukj 7y agoAssume that it is a black box to you, even though it is a white box to me. Every time you call read() on it - you get a different result. It has side-effects. This violates the “purity” of Mathematics.
- diegoperini 7y agoI just explained three different models to represent side-effects without leaving the purity. I'm not sure if you are trolling, throwing random big words or simply have a really misguided impression about how computer science connects with math.
- ukj 7y agoYour monad(WorldState, Value) example assumes shared global state. So not a networked system then? That's not a train-smash for your argument if you can show me a Mathematical model for a global mutex. When the discussion turns to control-flow you are inevitably in the land of well-ordered imperatives, not Mathematical, lazy-evaluated declaratives.