At the solutions page for problem 9 from the 99 problems : https://wiki.haskell.org/99_questions/Solutions/9 The, currently, second solution is not correct and shouldn't be listed. The solutions text states: Another simple recursive solution grp [] = [] grp (x:xs) = (x:(filter (==x) xs)):(grp $ filter (/=x) xs)