> module Main where
> input = "aaaabbbcca"
> r :: String -> (Char,Int) -> [(String, Int)]
> r [] (c,n) = [([c],n)]
> r (x:xs) (c,n)
> | c == x = r xs (c,n+1)
> | otherwise = (([c],n): r xs (x,1))
> main = putStrLn (show (r (tail input) (head input, 1) ))
4 minutes 42 seconds.
And no, I don't write code like this normally, but I guess this is me when I'm under time pressure... anyway, I could refactor it nicely afterwards in the 25 minutes allocated.