by willtim · 9y ago · 0 comments
All composition of IO actions is performed with full referential transparency and adherence to the Wikipedia definition.
Moreover, if you invoke these functions multiple times they will produce different results.
Hence, no strict adherence to FP principles.
No this isn't true! Again, you clearly do not yet understand Monads. Please read Phil Wadler's paper.
What you have successfully demonstrated, is that the JavaScript snippets you have been advocating are not sufficient to understand Monads.
the io monad is a pure function that produces impure code for the haskell runtime to execute (this isn't exactly accurate, but i think is an okay way to think about it). It will always produce the same impure code, and so is itself pure.