I am having a problem with my function, I want to do a pattern matching on a string with my function but I have a problem with breaking the string into substrings. I want for a string like "ccaabbccaacc" and a regular expresion like "a*b*c*" to obtain ["cc", "aabbcc", "aacc", ""], a list with the breaked subtring. I have made this function which returns all the parts of the substring
parts :: [a] -> [[[a]]] parts [ ] = [[ ]] parts [c] = [[[c]]] parts (c : cs) = concat [[(c : p) : ps ,[c] : p : ps] | p : ps <- parts cs] but when I apply my matchs function overt all the results it returns more that i want and i don't know how to filter the results. Can somene help me?