title: Find min element's index of a large list in Haskell
body: <p>i know some way to find the min or max element's index, but when i deal with a large list. ghc said:"stack overflow"</p>
  
  <p>So i go to stack overflow.</p>
  
  <pre><code>Prelude&gt; :m Data.List
  Prelude Data.List&gt; let a = reverse [1..10000000]
  Prelude Data.List&gt; elemIndex  (minimum a) a
  *** Exception: stack overflow
  </code></pre>
  
  <p>This way is better than using elemIndex but it can't solve 'reverse [1..100000000]'.</p>
  
  <pre><code>subset [] = [[]]
  subset (x:xs) = s ++ map ( x : ) s
  where s = subset xs
  
  minIndex xs = snd . minimum $ zip xs [0..]
  </code></pre>
  
  <p>How can i find min element's index of a large list?</p>
  
  <p>You'd better not use other module, just using prelude.</p>