Is there a function to concatenate elements of a list with a separator? For example:
> foobar \" \" [\"is\",\"there\",\"such\",\"a\",\"function\",\"?\"]
[
If you wanted to write your own versions of intercalate and intersperse:
intercalate :: [a] -> [[a]] -> [a]
intercalate s [] = []
intercalate s [x] = x
intercalate s (x:xs) = x ++ s ++ (intercalate s xs)
intersperse :: a -> [a] -> [a]
intersperse s [] = []
intersperse s [x] = [x]
intersperse s (x:xs) = x : s : (intersperse s xs)