Hacker News new | ask | show | jobs
by mbrock 3626 days ago
The return value of the function is a description of an effect. Calling the function doesn't cause the effect to happen. That's why you could, for example, call the function many times and get a list of IO actions which you then execute in parallel or backwards or whatever. Hence "inversion of control".
1 comments

I was debating whether on not to put that last sentence because I knew that it would lead to a technical discussion that was aside from the meaning of the question. My question is more -- why choose an `IO ()` as an example of something being called for its value (especially since the article isn't aimed at a Haskell audience)
Yeah, that's probably not a wise decision on part of the author. The IO monad is nifty but of minor importance in the grand scheme of things, and distracts when making a mostly language independent point.