title: Multiple 'Just x' for 'case maybeVal of' in haskell
body: <p>Do multiple 'Just' cases work in haskell, and in order eg. in </p>
  
  <pre><code>findElement :: Ord a =&gt; a -&gt; [a] -&gt; Maybe Int
  findElement element list = case (listToMaybe list) of
                               Nothing -&gt; Nothing
                               Just element -&gt; Just 0
                               Just _ -&gt; Just (1 + (fromMaybe 0 (findElement element (tail list))))
  </code></pre>
  
  <p>Only one of Just cases seem to work (which-ever is placed first).
  Expected outcome is-</p>
  
  <pre><code>&gt; findElement 4 [1,2,3,4,5,6,7,8]
  Just 3
  &gt; findElement 3 [5,6,4,7,8,0]
  Nothing
  &gt; findElement 4 []
  Nothing
  &gt; findElement 'o' "Hello world"
  Just 4
  &gt; findElement 'x' ""
  Nothing
  </code></pre>