title: Patterns not matched: (_:_:_)
body: <p>So I'm trying to build a function that takes a list of tuples and finds the tuple with the biggest second element. But I'm getting a pattern match error.     </p>
  
  <p>This is my code.</p>
  
  <pre><code>    resultTuple :: [((Int,Int),Int)] -&gt; (Int,Int)
      resultTuple [] = error "something wrong"
      resultTuple [x] = fst(x)
      resultTuple (x:y:xs)
          | snd(x) &gt;= snd(y) = resultTuple(x:xs)
          | snd(x) &lt; snd(y) = resultTuple(y:xs)
  </code></pre>
  
  <p>This is my error.</p>
  
  <pre><code>Pattern match(es) are non-exhaustive
  In an equation for ‘resultTuple’: Patterns not matched: (_:_:_)
  </code></pre>