4 ms·
That would be equally true of a programming model where every program is a pure function from a list of input lines to a list of output lines. Everyone would a
by anderskaseorg 5y ago
That would be equally true of a programming model where every program is a pure function from a list of input lines to a list of output lines. Everyone would agree that such a model is pure (if limiting), even though the function itself is just a function, and the language runtime takes care of the ugly low-level details of actually making the system calls that read lines from STDIN and write lines to STDOUT.
Purity doesn’t mean that effects don’t happen. It means that effects don’t happen as a side effect of mere expression evaluation.
- Twisol 5y ago> Purity doesn’t mean that effects don’t happen. It means that effects don’t happen as a side effect of mere expression evaluation. I don't disagree? I was adding color to your explanation for other readers, not attempting to correct you. The evaluation of a program merely reduces or simplifies it, transforming its structure without adding or removing information. When we can't reduce further without interacting with the environment, something else must mediate that interaction. > That would be equally true of a programming model where every program is a pure function from a list of input lines to a list of output lines. Indeed, Haskell used this model (`[Request] -> [Response]`) before switching to use an IO monad. It made for a poor architectural basis for complex programs.