title: Non-exhaustive patterns error when recursion a list
body: <p>I'm getting the following error, if I try to execute my <code>x_length</code> function, that should measure the length of a given list:</p>
  
  <blockquote>
    <p>Exception: test.hs:2:1-36: Non-exhaustive patterns in function x_length</p>
  </blockquote>
  
  <p>I load my <code>test.hs</code> file into ghci with <code>Prelude&gt;:l test.hs</code>.</p>
  
  <p>The implementation of the <code>x_length</code> function is (within the <code>test.hs</code> file):</p>
  
  <pre><code>x_length :: [Int] -&gt; Int
  x_length (x:xs) = 1 + x_length xs
  </code></pre>
  
  <p>I've already figured out, that it has to do something with loading the <code>test.hs</code> file, but I haven't figured out, how to solve this issue.</p>
  
  <p>The actual function call I do with <code>x_length [1,2,3,4]</code>.</p>