3 ms·
Pure.println is pure up until you call run -- because it doesn't actually do anything until that point. In the Example, Example.io gives the structure of the co
by noelwelsh 12y ago
Pure.println is pure up until you call run -- because it doesn't actually do anything until that point. In the Example, Example.io gives the structure of the computation and Example.run actually runs it. It's this separation that allows monadic IO to be pure (until it is run).
As the author of the article I'm probably not the best person to give a different perspective on the article. Hope that helps in any case.
- serve_yay 12y agoWell, OK. You end up with an impure thunk from Pure.println, Pure.println itself is pure.