title: Compare 2 characters in a string (haskell)
body: <p>my function should return the longest prefix consisting of the same character. For example:
  &quot;aaaabc&quot; == &quot;aaaa&quot; or &quot;abc&quot; == &quot;a&quot;</p>
  <p>How can I compare the first character with the rest of the characters?</p>
  <p>My idea:</p>
  <pre><code>testString :: String -&gt; String
  testString input = 
  if head input == head (tail input) then testString (input)
  else head [input]
  </code></pre>
  <p>I should use only the keywords: tail, head, ++ or :</p>