I\'ve had the IO monad described to me as a State monad where the state is \"the real world\". The proponents of this approach to IO argue that this makes IO operations pure
Philip Wadler writes:
In an impure language, an operation like
tickwould be represented by a function of type() -> (). The spurious argument()is required to delay the effect until the function is applied, and since the output type is()one may guess that the function's purpose lies in a side effect. In contrast, heretickhas typeM (): no spurious argument is needed, and the appearance ofMexplicitly indicates what sort of effect may occur.
I fail to understand how M () makes the empty argument list () less spurious but Wadler is pretty clear that monads just indicate a kind of side-effect, they do not eliminate it.