[Haskell-cafe] Review request for my permutations implementation

2010-01-07 Thread CK Kashyap
Hi All, I've written this piece of code to do permutations - perms :: String - [String] perms []= [] perms (x:[])= [[x]] perms (x:xs)= concat (f [x] (perms xs)) spread :: String - String - [String] -- interpolate first string at various positions of second string spread str1 str2 = _spread

Re: [Haskell-cafe] Review request for my permutations implementation

2010-01-07 Thread Jochem Berndsen
CK Kashyap wrote: I've written this piece of code to do permutations - First off, this is a recurring topic. If you search the archives, you'll find some more topics about it. perms :: String - [String] Why this type? Since a String is just a list of Char, and you don't use the fact that

Re: [Haskell-cafe] Review request for my permutations implementation

2010-01-07 Thread Daniel Fischer
Am Donnerstag 07 Januar 2010 09:37:42 schrieb CK Kashyap: Hi All, I've written this piece of code to do permutations - perms :: String - [String] Nothing in the algorithm needs the list elements to be Chars, there's no type class involved, so it should be perms :: [a] - [[a]] perms []=

Re: [Haskell-cafe] Review request for my permutations implementation

2010-01-07 Thread Rafael Gustavo da Cunha Pereira Pinto
Hi, Is there an entry in the haskell wiki for permutations? Since this is a recurring topic, as primes, shouldn't we create a topic for that in the wiki? Regards, Rafael On Thu, Jan 7, 2010 at 08:46, Daniel Fischer daniel.is.fisc...@web.dewrote: Am Donnerstag 07 Januar 2010 09:37:42

Re: [Haskell-cafe] Review request for my permutations implementation

2010-01-07 Thread CK Kashyap
request for my permutations implementation Am Donnerstag 07 Januar 2010 09:37:42 schrieb CK Kashyap: Hi All, I've written this piece of code to do permutations - perms :: String - [String] Nothing in the algorithm needs the list elements to be Chars, there's no type class involved, so