The stringsearch package provides fast find/replace functionality for Haskell ByteStrings. Does there exist corresponding functionality for the text strings defined in the Data.Text package?
The only approaches I can see at the moment involve encoding to UTF8, using stringsearch, and then converting back---which isn't really ideal!
Efficient Boyer-Moore search for Text is implemented in the package out of the box. See the source here: http://hackage.haskell.org/packages/archive/text/0.11.1.5/doc/html/src/Data-Text-Search.html
Access to this functionality is through the standard Text API -- splitOn
, breakOn
, count
, replace
, and isInfixOf
in particular.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With