Re: idiom for producing comma-seperated lists?

2003-08-14 Thread Antony Courtney
Ketil Z. Malde wrote: Antony Courtney [EMAIL PROTECTED] writes: -- Example: format a list of strings, using a comma as a seperator: mkSepStr :: [String] - String mkSepStr xs = foldrs (\x s - x ++ , ++ s) xs t0 = mkSepStr [] -- == t1 = mkSepStr [hello]-- == hello

Re: idiom for producing comma-seperated lists?

2003-08-14 Thread Ketil Z. Malde
Antony Courtney [EMAIL PROTECTED] writes: -- Example: format a list of strings, using a comma as a seperator: mkSepStr :: [String] - String mkSepStr xs = foldrs (\x s - x ++ , ++ s) xs t0 = mkSepStr [] -- == t1 = mkSepStr [hello]-- == hello t2 = mkSepStr

idiom for producing comma-seperated lists?

2003-08-11 Thread Antony Courtney
I often need to format a list of strings using some character as a *seperator* rather than a terminator for the items. Is there some simple combinator or idiom from the Prelude or standard libraries that could be used for this purpose? I ended up defining my own variation on foldr1 to solve

Re: idiom for producing comma-seperated lists?

2003-08-08 Thread D. Tweed
On Fri, 8 Aug 2003, Antony Courtney wrote: I often need to format a list of strings using some character as a *seperator* rather than a terminator for the items. Is there some simple combinator or idiom from the Prelude or standard libraries that could be used for this purpose? I think