title: Add index to tuples
body: <p>I have a function <code>addIndex [1,2,3] = [(0,1),(1,2),(2,3)]</code> which should add an index to each pair I am having trouble implementing this. Here what I have done;</p>
  
  <pre><code>addIndexs :: [Int] -&gt; [(Int,Int)]
  addIndexs [] = []
  addIndexs x = zip x [1..length x]
  </code></pre>
  
  <p>I am able to implement it using zip put I feel its cheating, I want to be able to implement it without using any pre build functions.</p>
  
  <p>The closest I have got without using pre build function is </p>
  
  <pre><code>addindex x = [(i,z) | z &lt;- x, i &lt;-[1..length x]]
  </code></pre>
  
  <p>however this add all index to each tuples so </p>
  
  <pre><code>addIndex [1,2,3] = [(0,1),(1,1),(2,1),(0,2),(1,2),(2,2)...]
  </code></pre>
  
  <p>I am just a beginner.</p>