title: sorting array of tuple in haskell by index
body: <p>I write  a code to sort index of tuple list  I try to use <strong>map</strong> with <code>bubblesort()</code>
  to avoid using <strong>loops</strong></p>
  
  <pre><code>     bubblesort::(Ord t) =&gt; [t]-&gt;[t]
       bubblesort[x,y,z,xs]=
                  if x&lt;y then x : map bubblesort [y,z,xs]
                         else y : map bubblesort [x,z,xs]  
  </code></pre>
  
  <p>but it give me an error that :</p>
  
  <pre>
  ERROR line 20 - Type error in list
  *** Expression     : [y,xs]
  *** Term           : xs
  *** Type           : [a]
  *** Does not match : a
  *** Because        : unification would give infinite type
  </pre>
  
  <p>*note please give me instruction only </p>
  
  <p>--The complier is online compiler </p>