How is IO monad actually implemented?in sense of, what would be the actual implementation of the main
function?
How would I call haskell function (IO) f
If you want to understand the implementation of the IO monad, it's very well described in an award-winning paper by Phil Wadler and Simon Peyton Jones, who were the ones who figured out how to use monads to do input/output in a pure language. The paper is Imperative Functional Programming and is on both authors' web sites.