[Haskell-cafe] Please tell me this function exists

Richard O'Keefe ok at cs.otago.ac.nz
Wed Dec 17 20:08:44 EST 2008


On 18 Dec 2008, at 7:36 am, Brian Hurt wrote:

>
> I know it's not hard to write, but still:
>
> concat :: String -> [String] -> String
> concat _ [] = ""
> concat _ [x] = x
> concat sep x:xs = x ++ sep ++ (concat sep xs)
>
> I've got to be stupid and missing it in the standard libraries.

You want  concat (intersperse sep strings)  using functions from List.




More information about the Haskell-Cafe mailing list