title: exception error: no match of right hand side value []
body: <p>I am trying to see if a letter exists in a list, i am currently doing like the following </p>
  
  <pre><code>sortedlist(Text)-&gt; freq(lists:sort(Text)).
  
  freq(List) -&gt; freq (List, [], []).
  
  freq(List, Freq, CheckedLetters) when length(List) &gt; 0 -&gt; 
      [CurrHead|T]= List,
      Checked = lists:member(CurrHead,CheckedLetters),
      case Checked of
              false -&gt; CheckedLetters++[CurrHead],
                      freq(T,Freq++[{CurrHead,count(CurrHead, List)}],CheckedLetters);
              true -&gt; freq(T,Freq,CheckedLetters)
      end;
  freq([],Freq,CheckedLetters)-&gt; Freq.
  </code></pre>
  
  <ul>
  <li><p>List contains user entered letters</p></li>
  <li><p>CheckedLetters is an empty list, that will keep track of the already examined letters </p></li>
  </ul>
  
  <p>But I am receiving the following erlang exception at the case-statement line (the lines with **).</p>
  
  <blockquote>
    <p>error: no match of right hand side value [] </p>
  </blockquote>
  
  <p>What is the problem here? I am been blindy staring at those lines.</p>