title: In Haskell, how to generate a perfectly balanced binary search tree?
body: <p>The function should takes a list xs and constructs a balanced binary search tree consisting of exactly the same set of elements as xs.</p>
  
  <p>The result should be like this:
  (if the list is [1,2,3,4,5,6,7,8])</p>
  
  <p>Node (Node (Node (Node Empty 1 Empty) 2 Empty) 4 (Node Empty 4 Empty)) 5 (Node (Node Empty 6 Empty) 7 (Node Empty 8 Empty))</p>
  
  <p>that is to say the tree should look like this:</p>
  
  <pre><code>                5
                 / \
                3   7
               / \ / \
              2  4 6  8
             /
            1
  </code></pre>
  
  <p>rather than this:</p>
  
  <pre><code>                5
                 / \
                4   6
               /     \
              3       7
             /         \
            2           8
           /
          1
  </code></pre>
  
  <p>Could anybody tell me how to do this? I find I can do the second tree which is not perfectly balanced, but don't know how to do the first one.</p>
  
  <p>I appreciate any help!!
  Thank you in advance!</p>