title: How to get the first index of a given element in Array/List in Elm?
body: <p>In Javascript, one could use <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf" rel="nofollow">indexOf</a> to get the first instance of a given element in an array.</p>
  
  <p>What's the best way to do this in Elm?</p>
  
  <pre class="lang-elm prettyprint-override"><code>array = Array.fromList ["Stack","Overflow","is","","awesome"]
  element = ""
  
  indexOf element array =
    -- should return 3
  </code></pre>
  
  <p>What if we have a list instead of an array?</p>