title: haskell if true then break or continue loop
body: <p>I am fairly new to Haskell.</p>
  
  <p>I want to pass two items:</p>
  
  <p>First a list of numbers as strings say <code>["1","2","3","4"]</code> and I want to see if each of these items appears in  random string of numbers say <code>"14321"</code></p>
  
  <p>e.g <code>myFunction ["6","2","3"] "1234"</code></p>
  
  <p>My return value will be a maybe type where i want to return <code>Just("the number found", "14321")</code>.
  With the first return param will be the number found in the list, and the second being the string originally passed.</p>
  
  <p>The thing is, I only want to return the first instance of a match as a maybe, and if there is no match's return nothing.</p>
  
  <p>I am unsure how to do a loop like this, to check if one matchs and if so return and finish or keep going to the next item in the list.</p>
  
  <p>I have this:</p>
  
  <pre><code>isMatch :: [String] -&gt; String -&gt; Maybe (String,String)
  isMatch (x:xs) test | x `isInfixOf` test = Just (x, test)
                      | otherwise = Nothing
  </code></pre>
  
  <p>It should work if the first match is true, but if not, how can I get it to continue onto the next in the list?</p>
  
  <p>Thanks in advance</p>