summaryrefslogblamecommitdiff
path: root/1-10/8.hs
blob: 01d1781a2de72b32ae8bf8e0d0f8d6080d90bb84 (plain) (tree)
1
2
3
4



                                                                       
compress :: Eq a => [a] -> [a]
compress (x:y:xs) = if x == y then compress(y:xs) else x:compress(y:xs)
compress [] = []
compress [x] = [x]