title: erlang - quicksort. The standard quicksort program from learnyousomeerlang
body: <p>What is the difference? why am i getting only first element in list?</p>
  
  <pre><code>    -module(hello).
  -export(quicksort/1,                                                                                 
      lc_quicksort/1]).
  
  quicksort([]) -&gt; []; 
  quicksort([Pivot|Rest]) -&gt;
      quicksort([x || x &lt;- Rest, x =&lt; Pivot])
      ++[Pivot]
      ++ quicksort([y || y &lt;- Rest, y &gt; Pivot]).
  
  lc_quicksort([]) -&gt; []; 
  lc_quicksort([Pivot|Rest]) -&gt;
  lc_quicksort([Smaller || Smaller &lt;- Rest, Smaller =&lt; Pivot])
  ++ [Pivot] ++
  lc_quicksort([Larger || Larger &lt;- Rest, Larger &gt; Pivot]).
  
  
  
  1&gt; c("hello.erl").
  
  {ok,hello}
  
  2&gt; hello:quicksort([3, 1, 4, 2, 5, 9]).
  
  [3]
  
  3&gt;  hello:lc_quicksort([3, 1, 4, 2, 5, 9]).
  
  [1,2,3,4,5,9]
  </code></pre>
  
  <p>What am i missing? Posting this to learn that functionality of erlang that I missed while learning.</p>
  
  <p>Thanks.</p>