title: How to "debug" Haskell with printfs?
body: <p>coming from the Ocaml community, I'm trying to learn a bit of Haskell. The transition goes quite well but I'm a bit confused with debugging. I used to put (lots of) "printf" in my ocaml code, to inspect some intermediate values, or as flag to see where the computation exactly failed.</p>
  
  <p>Since printf is an <strong>IO</strong> action, do I have to lift all my haskell code inside the <strong>IO</strong> monad to be able to this kind of debugging ? Or is there a better way to do this (I really don't want to do it by hand if it can be avoided)</p>
  
  <p>I also find the <strong>trace</strong> function : 
  <a href="http://www.haskell.org/haskellwiki/Debugging#Printf_and_friends" rel="noreferrer">http://www.haskell.org/haskellwiki/Debugging#Printf_and_friends</a>
  which seems exactly what I want, but I don't understand it's type: there is no <strong>IO</strong> anywhere!
  Can someone explain me the behaviour of the trace function ?</p>