title: Finding index of element in a list in Haskell?
body: <p>I have a function in <a href="http://en.wikipedia.org/wiki/Haskell_(programming_language)" rel="noreferrer">Haskell</a> which finds the maximum value of an exponentiation from a list:</p>
  
  <pre><code>prob99 = maximum $ map (\xs -&gt; (head xs)^(head (tail xs))) numbers
  </code></pre>
  
  <p>What I need to find is the location of this maximum value in the resultant list. How would I go about this?</p>
  
  <p>Edit: I found a solution that goes like this:</p>
  
  <pre><code>n = [[519432,525806],[632382,518061]....
  prob99b [a,b] = b* (log a)
  answer = snd $ maximum (zip  (map prob99b n) [1..])
  </code></pre>