title: Recursion on a list of tuples
body: <p>I want to make a program that</p>
  <ul>
  <li>takes a character and a list of pairs of characters as arguments,</li>
  <li>returns the first element of the pair if it is equal to the input character, or returns the unchanged pair otherwise.</li>
  </ul>
  <p>I have the following code:</p>
  <pre><code>lookUp :: Char -&gt; [(Char, Char)] -&gt; Char    
  lookUp a [] = []
  lookUp a [(x,y),(xs,ys)]
     | a == x = y : lookUp [(xs,ys)]
     | otherwise = x : y : lookUp [(xs,ys)]
  </code></pre>
  <p>When I compile it, I get a lot of mistakes:</p>
  <blockquote>
  <p>Couldn't match expected type 'char' with actual type [t0]</p>
  <p>In an equation for 'lookUp'</p>
  </blockquote>
  <p>and so on...</p>
  <p>Sorry, I'm relatively new to Haskell. I'm pretty sure I made a mistake when dealing recursively with the tuple  (<code>[(x,y),(xs,ys)]</code>), but I don't know how to change it. Any ideas?</p>