Is there a function to concatenate elements of a list with a separator? For example:
> foobar \" \" [\"is\",\"there\",\"such\",\"a\",\"function\",\"?\"]
[
Some other ideas of implementations of intersperse and intercalate, if someone is interested:
myIntersperse :: a -> [a] -> [a]
myIntersperse _ [] = []
myIntersperse e xs = init $ xs >>= (:[e])
myIntercalate :: [a] -> [[a]] -> [a]
myIntercalate e xs = concat $ myIntersperse e xs
xs >>= f is equivalent to concat (map f xs).