It took me a while to figure out how to do this right in haskell. In case you know of a better solution please tell me about it in the comment section.
replaceAll a b c =
concat (intersperse b (splitRegex regex c))
where
regex = Text.Regex.mkRegex a