Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Haskell Help

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) = ??

Name: Anonymous 2009-06-24 9:41

insertions :: x -> [x] -> [[x]]
insertions x [] = [[]]
insertions x (y:ys) = (y:ys).map(function(s:String, i:int, array:Array) {
  return x + s;
})

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List