Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



And 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.


certainly 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: