I have this function where i compress a string
compression :: String -> [(Char,Int)] compression str = map (\\lt -> (head lt, length lt)) (group str)