idiom for producing comma-seperated lists?

D. Tweed tweed@compsci.bristol.ac.uk
Fri, 8 Aug 2003 14:59:08 +0100 (BST)


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 the primary intended use for `intersperse' from the List library
is to be used as in

import List

mkSepStr = concat . intersperse ", "

HTH,

___cheers,_dave_________________________________________________________
www.cs.bris.ac.uk/~tweed/  |  `It's no good going home to practise
email:tweed@cs.bris.ac.uk  |   a Special Outdoor Song which Has To Be
work tel:(0117) 954-5250   |   Sung In The Snow' -- Winnie the Pooh