Name: Anonymous 2009-06-23 21:22
Okay, major help needed if someone out there has the time, this has been killing my brain for ages.
-- e.g., insertions 'c' "ab" = ["cab", "acb", "abc"]
-- It may help to define two functions which call each other.
Thus far I have.
insertions :: x -> [x] -> [[x]]
insertions x [] = [[]]
insertions x (y:ys) = ??
-- e.g., insertions 'c' "ab" = ["cab", "acb", "abc"]
-- It may help to define two functions which call each other.
Thus far I have.
insertions :: x -> [x] -> [[x]]
insertions x [] = [[]]
insertions x (y:ys) = ??