title: How can I make a function that finds the common elements of two strings?
body: <p>I want to learn how to create functions using mainly head and tail. What I need to know is the protocol or presentation of elements, how to identify the elements, and how to define the function. For example, I am practicing how to write a simple function to find the common elements of two strings. Like this:</p>
  
  <pre><code>commonElt :: (Eq a)=&gt; [a]-&gt;[a]-&gt; bool
  
                  commonElt [] _ = true
                  commonElt _ [] = false
  commonElt s1 s2 |if elm (head s1)s2 == true then show head s1 &amp;&amp; commonElt(tail s1)s2
                  |otherwise = commonElt(tail s1) s2
  </code></pre>
  
  <p>where <code>s1</code> and <code>s2</code> are strings. But I cannot load the modules because I get the following error message:  "parse error. possible incorrect identation."</p>