4 ms·
So basically, “main” is not an impure function. It’s a pure value representing an impure function. A monad is essentially a data type that represents computatio
by evincarofautumn 14y ago
So basically, “main” is not an impure function. It’s a pure value representing an impure function. A monad is essentially a data type that represents computations in some domain-specific language, using data (return) and code (>>=) from the host language. The only thing special about the IO datatype is that the impure Haskell runtime can evaluate it.