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
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
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
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