2 ms·
The "pretty much" does all the work here though. It's not pure if you can modify the state of a global, the file system, the environment, the standard output,
by rhn_mk1 4y ago
The "pretty much" does all the work here though.
It's not pure if you can modify the state of a global, the file system, the environment, the standard output, etc., and this is half of the reason why purity is desired.
- zabzonk 4y agocertainly desired, but not always possible, seeing as we actually want to do state changes, for example output, unless with much hand-waving monads, which of course really do change state.
- jb1991 4y agoAnd it’s not just about modification, it’s also not pure if you simply read data that is not passed into the function via parameters. Because in a pure function, you don’t need to access anything, reading or writing, that is outside of the function itself.