3 ms·
In real-world FP programs there will be some impure code. But that impure code should be in thin outer layers. The core needs to be pure. Why? Because otherwise
by flowerlad 5y ago
In real-world FP programs there will be some impure code. But that impure code should be in thin outer layers. The core needs to be pure. Why? Because otherwise it defeats the purpose of FP. The purpose of FP is easy verification and ease of reasoning about code. That's only possible if most of the code is pure functions.
There is really no need shoehorn something that's not a good fit for FP into the FP paradigm. It is not like customers are going to pay more money if it is FP. So don't bother.