4 ms·
IO isn't functional and that's the reason FP languages such as Haskell have a system for dealing with functions that have side-effects, that neatly separates th
by flowerlad 6y ago
IO isn't functional and that's the reason FP languages such as Haskell have a system for dealing with functions that have side-effects, that neatly separates the part of the program that is pure and the part of the program that is impure (and does all the dirty work like updating the screen). Impure parts of the program is fenced off from the pure parts. Pure functions cannot call impure functions.
The important part here is keeping portions of your code that has side-effects separate — and minimizing the amount of such code. If code that has side-effects is spread all over your program then you are not really using functional style.
More on that here: https://medium.com/weekly-webtips/dysfunctional-programming-in-javascript-cae5c085a76e https://medium.com/weekly-webtips/dysfunctional-programming-...
- eyelidlessness 6y agoThat was exactly my point!