title: How to count occurence of an item in a list?
body: <p>I have been messing around with Haskell for two weeks now and have some functions written in Haskell. I heard that Erlang was quite similar(since they are both predominately functional) so I thought I would translate some of these functions to see if I could get them working in Erlang. However I have been having trouble with the syntax for this function I wrote. The purpose of this function is to simply take a character or int and go through a list. After it goes through the list I am just trying to count the amount of times that item occurs. Here is an example run it should return the following. </p>
  
  <pre><code> count (3, [3, 3, 2, 3, 2, 5])  ----&gt; 3
   count (c, [ a, b, c, d]) ----&gt; 1
  </code></pre>
  
  <p>Whenever I run my code it just keeps spitting out syntax issues and it is really a pain debugging in Erlang. Here is the code I have written: </p>
  
  <pre><code>count(X,L) -&gt;
    X (L:ls) -&gt;
    X == L = 1+(count X ls);
    count X ls.
  </code></pre>
  
  <p>Any ideas I can do to fix this? </p>