title: How does one pretty print recursion depth in Haskell?
body: <p>Let's say I have a binary tree.</p>
  
  <pre><code>main = putStrLn $ printTree tree                                                                                                                                                                                
  
  data Tree = Empty | Node Int (Tree) (Tree) deriving (Show)                                                                                                                                                      
  
  tree = Node 4 (Node 3 Empty (Node 2 Empty Empty)) Empty                                                                                                                                                         
  
  printTree :: Tree -&gt; String                                                                                                                                                                                     
  printTree x = case x of                                                                                                                                                                                         
    Node num treeA treeB -&gt; show num ++ "\n" ++ printTree treeA ++ "\n" ++ printTree treeB                                                                                                                        
    Empty -&gt; "Empty" 
  </code></pre>
  
  <p>Output</p>
  
  <pre><code>*Main&gt; main                                                                                                                                                                                                     
  4                                                                                                                                                                                                               
  3                                                                                                                                                                                                               
  Empty                                                                                                                                                                                                           
  2                                                                                                                                                                                                               
  Empty                                                                                                                                                                                                           
  Empty                                                                                                                                                                                                           
  Empty 
  </code></pre>
  
  <p>Desired Output (delimited by tabs or double space is fine)</p>
  
  <pre><code>*Main&gt; main                                                                                                                                                                                                     
      4                                                                                                                                                                                                               
        3                                                                                                                                                                                                               
          Empty                                                                                                                                                                                                           
          2                                                                                                                                                                                                               
            Empty                                                                                                                                                                                                           
            Empty                                                                                                                                                                                                           
        Empty 
  </code></pre>