4 ms·
"locally stateful, globally pure-functional" Can you expand on that, please? Because it seems to me that state fulness propagates up through the system. I can'
by krisajenkins 11y ago
"locally stateful, globally pure-functional"
Can you expand on that, please? Because it seems to me that state fulness propagates up through the system. I can't imagine a system that was pure in the large but side-effecting in the small. I'd be interested to hear how that works...
- dragonwriter 11y agoOne way is to use local mutable state within functions that are implemented so as to be not rely on external state, which are then indistinguishable to calling code from pure functions.
- mafribe 11y agoYes, that's what I had in mind. If only there was an effect system that could guarantee purity and at the same time not be in the way (i.e. allow full or Scala-like type inference). Then purity would be guaranteed by types, like it is in Haskell. (N.B. I'm not asking for Haskell's purity by default. I advocate impure as default, with a type guarantting purity.)