-- Problem 8
-- (**) Eliminate consecutive duplicates of list elements.
--
-- > compress "aaaabccaadeeee"
-- "abcade"

compress :: Eq a => [a] -> [a]
compress [] = []
compress (c:x:xs) | c == x = compress (x:xs)
compress (x:xs) = [x] ++ compress xs
