Best way for substring replace in haskell

There is Data.String.Utils.replace in the MissingH package. If you only need plain substring replace (and not regular expressions), this might be what you need.


The regex-xmlschema package has a sed function that might be what you're looking for:

http://hackage.haskell.org/package/regex-xmlschema-0.1.3

See particularly:

http://hackage.haskell.org/packages/archive/regex-xmlschema/0.1.3/doc/html/Text-Regex-XMLSchema-String.html#v:sed

There was a discussion of options for string rewriting on Haskell-Cafe last year:

http://www.haskell.org/pipermail/haskell-cafe/2010-May/077943.html