title: Intuitively, how does Haskell find the length of a list without using a standard length function?
body: <p>I just started learning Haskell and was trying to write a program which computes the number of elements in a list. I found this code online:</p>
  
  <pre><code>listnumber :: [Int] -&gt; Int 
  listnumber [] = 0
  listnumber (x:xs) =1 + listnumber xs
  </code></pre>
  
  <p>After loading in GHCi the program returns the length of the list as expected. But how does this code work intuitively?</p>