Re: [Haskell] String permutation

2006-07-26 Thread Sukit Tretriluxana
Thank you so much for all the responses. They really open my eyes how flexible and powerful Haskell is. EdOn 7/26/06, Sebastian Sylvan < [EMAIL PROTECTED]> wrote:On 7/26/06, Sukit Tretriluxana < [EMAIL PROTECTED]> wrote:> Dear expert Haskellers,>> I am a newbie to Haskell and try to write several a

Re: [Haskell] String permutation

2006-07-26 Thread Sebastian Sylvan
On 7/26/06, Sukit Tretriluxana <[EMAIL PROTECTED]> wrote: Dear expert Haskellers, I am a newbie to Haskell and try to write several algorithms with it. One of them is the string permutation which generates all possible permutations using the characters in the string. For example, if I say, perm

Re: [Haskell] String permutation

2006-07-26 Thread Martin Erwig
On Jul 26, 2006, at 6:59 AM, Robert Dockins wrote: On Jul 26, 2006, at 12:44 AM, Sukit Tretriluxana wrote: Dear expert Haskellers, I am a newbie to Haskell and try to write several algorithms with it. One of them is the string permutation which generates all possible permutations using

Re: [Haskell] String permutation

2006-07-26 Thread Robert Dockins
On Jul 26, 2006, at 12:44 AM, Sukit Tretriluxana wrote: Dear expert Haskellers, I am a newbie to Haskell and try to write several algorithms with it. One of them is the string permutation which generates all possible permutations using the characters in the string. For example, if I say,

Re: [Haskell] String permutation

2006-07-26 Thread Tomasz Zielonka
On Tue, Jul 25, 2006 at 09:44:36PM -0700, Sukit Tretriluxana wrote: > permute :: String -> [String] > permute str = rotate str len len > where len = length str > > rotate :: String -> Int -> Int -> [String] > rotate _ _ 0 = [] > rotate s 1 _ = [s] > rotate (ch:chs) len rcnt = > map (\x -> ch :

Re: [Haskell] String permutation

2006-07-26 Thread Martin Percossi
Sukit Tretriluxana wrote: Dear expert Haskellers, I am a newbie to Haskell and try to write several algorithms with it. One of them is the string permutation which generates all possible permutations using the characters in the string. While I could hardly be called an expert haskeller, her

Re: [Haskell] String permutation

2006-07-26 Thread CHA Reeseo
On Wednesday 26 July 2006 13:44, Sukit Tretriluxana wrote: > Dear expert Haskellers, > > I am a newbie to Haskell and try to write several algorithms with it. One > of them is the string permutation which generates all possible permutations > using the characters in the string. For example, if I sa