title: What does myFunction(x:y:xs) mean in Haskell
body: <p>I am new to Haskell and I came across one thing that I can seem to come around.So I have this function:</p>
  
  <pre><code>merge :: [Int] -&gt; [Int]
  merge xs = merged ++ padding
  
  where padding          = replicate (length xs - length merged) 0
        merged           = combine (filter (/= 0) xs)
        combine (x:y:xs) | x == y    = x * 2 : combine xs
                         | otherwise = x     : combine (y:xs) 
        combine x        = x
  </code></pre>
  
  <p>The problem is that I can't quite grasp what combine does.I did my research and found that </p>
  
  <pre><code>myFunction(x:xs) ...
  </code></pre>
  
  <p>represents that "x" is somehow the head of my list,and I can do stuff with it,right?Does that mean that in <code>myFunction(x:y:xs) ...</code>
  "x" is the last element and "y" would be the second to the last element in xs?Is this right or am I terribly wrong?Also what about the ":" after "| x == y    = x * 2",I learned that in Haskell ":" means appending a value to a list,but in this context I really can't quite understand what it does...Some help would be much apreciated.</p>