title: How to bring an interpreter to the IO monad?
body: <p>My question relates to the simple interpreter written in <a href="https://stackoverflow.com/questions/16970431/implementing-a-language-interpreter-in-haskell/16971570#16971570">in this answer</a></p>
  
  <p>How could one add IO capabilities to <a href="https://stackoverflow.com/questions/16970431/implementing-a-language-interpreter-in-haskell/16971570#16971570">this interpreter</a> (the <strong>first non monadic</strong> version)? By this I simply mean adding a statement that uses putStrLn. I'm not that well versed in Haskell yet, but I'm guessing you can just combine the IO monad somehow. Can somebody point me in the right direction?</p>
  
  <pre><code>data Stmt
    = Var := Exp                                   
    | While Exp Stmt                                               
    | Seq [Stmt]      
    | Print Exp       -- a print statement
  </code></pre>