title: Haskell display tree function
body: <p>I'm trying to write a function, which displays a tree, substituting tree blocks with / or \ (left or right child) plus Int value under them.
  Tree is defined as follows:</p>
  
  <pre><code>    data Tree x 
        = Null
        | Leaf x
        | Node (Tree x) x (Tree x)
        deriving Show
  </code></pre>
  
  <p>and it can contain only five one digit values, so for example following tree:</p>
  
  <pre><code>    Node(Node(Leaf 1)(2)(Leaf 3))(3)(Node(Null)(4)(Leaf 5))
  </code></pre>
  
  <p>would be displayed this way:</p>
  
  <pre><code>             3
             /   \
            2     4
           / \     \
          1   3     5
  </code></pre>
  
  <p>I suppose that with more nodes and higher trees there would be some overlapping of nodes due to limited space, but it should be fine in this case, cause the function is to deal with binary search trees alone.</p>
  
  <p>I have a function at my disposal, which takes [[bool]] and prints lines, substituting booleans with characters, but... I have no idea how it could be used in this particular case... Any help will be appreciated.</p>