On Mon, 21 May 2007, Greg Meredith wrote:
HC-er's,
Find below some simple-minded code from a naive Haskeller for generating all
partitions of a multiset about which i have two questions.
mSplit :: [a] - [([a], [a])]
mSplit [x] = [([x],[])]
What about [] ?
See
HC-er's,
Find below some simple-minded code from a naive Haskeller for generating all
partitions of a multiset about which i have two questions.
mSplit :: [a] - [([a], [a])]
mSplit [x] = [([x],[])]
mSplit (x:xs) = (zip (map (x:) lxs) rxs)
++ (zip lxs (map (x:) rxs))