title: The length of a list without the "length" function in Haskell
body: <p>I want to see how long a list is, but without using the function <em><code>length</code></em>. I wrote this program and it does not work. Maybe you can tell me why? Thanks!</p>
  
  <pre><code>let y = 0
  main = do
    list (x:xs) = list (xs)
    y++
  
  list :: [Integer] -&gt; Integer
  list [] = y
  </code></pre>